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
path: root/qa/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 21:08:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 21:08:45 +0300
commit26a50872e9da9509c52c70f74dc21698fec906db (patch)
treeb1bd36bd72e701e346ef880fc7a905f6186525e7 /qa/spec
parentb3a736ed88a1db0391cd9881e70b987bab7d89d1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r--qa/spec/support/repeater_spec.rb30
-rw-r--r--qa/spec/support/waiter_spec.rb5
2 files changed, 35 insertions, 0 deletions
diff --git a/qa/spec/support/repeater_spec.rb b/qa/spec/support/repeater_spec.rb
index 20dca6608f6..b5d5058ef49 100644
--- a/qa/spec/support/repeater_spec.rb
+++ b/qa/spec/support/repeater_spec.rb
@@ -381,5 +381,35 @@ describe QA::Support::Repeater do
end
end
end
+
+ it 'logs attempts' do
+ attempted = false
+
+ expect do
+ subject.repeat_until(max_attempts: 1) do
+ unless attempted
+ attempted = true
+ break false
+ end
+
+ true
+ end
+ end.to output(/Attempt number/).to_stdout_from_any_process
+ end
+
+ it 'allows logging to be silenced' do
+ attempted = false
+
+ expect do
+ subject.repeat_until(max_attempts: 1, log: false) do
+ unless attempted
+ attempted = true
+ break false
+ end
+
+ true
+ end
+ end.not_to output.to_stdout_from_any_process
+ end
end
end
diff --git a/qa/spec/support/waiter_spec.rb b/qa/spec/support/waiter_spec.rb
index 40abf0d72a2..35f1e01289a 100644
--- a/qa/spec/support/waiter_spec.rb
+++ b/qa/spec/support/waiter_spec.rb
@@ -34,6 +34,11 @@ describe QA::Support::Waiter do
end
end
+ it 'allows logs to be silenced' do
+ expect { subject.wait_until(max_duration: 0, raise_on_failure: false, log: false) { false } }
+ .not_to output.to_stdout_from_any_process
+ end
+
it 'sets max_duration to 60 by default' do
expect(subject).to receive(:repeat_until).with(hash_including(max_duration: 60))