Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/kubernetes/pod_cmd_spec.rb')
-rw-r--r--spec/lib/gitlab/kubernetes/pod_cmd_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/kubernetes/pod_cmd_spec.rb b/spec/lib/gitlab/kubernetes/pod_cmd_spec.rb
new file mode 100644
index 00000000000..51bdbf64741
--- /dev/null
+++ b/spec/lib/gitlab/kubernetes/pod_cmd_spec.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+require 'fast_spec_helper'
+
+RSpec.describe Gitlab::Kubernetes::PodCmd do
+ describe '.retry_command' do
+ it 'constructs string properly' do
+ command = 'my command'
+ command_with_retries = "for i in $(seq 1 3); do #{command} && s=0 && break || s=$?; sleep 1s; echo \"Retrying ($i)...\"; done; (exit $s)"
+
+ expect(described_class.retry_command(command)).to eq command_with_retries
+ end
+ end
+end