diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 21:09:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 21:09:09 +0000 |
commit | 167894d0e7c98aae1c6d4f5a060ad6d58ea3f382 (patch) | |
tree | dd0ce964cf0db395b0b143a079c58bb4aabae591 /qa | |
parent | 411cc77938f99b495e0fe802705d275a28e939ef (diff) | |
download | gitlab-ce-167894d0e7c98aae1c6d4f5a060ad6d58ea3f382.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/flow/login.rb | 6 | ||||
-rw-r--r-- | qa/qa/page/base.rb | 4 | ||||
-rw-r--r-- | qa/qa/support/page/logging.rb | 7 | ||||
-rw-r--r-- | qa/qa/support/retrier.rb | 2 | ||||
-rw-r--r-- | qa/qa/support/waiter.rb | 2 | ||||
-rw-r--r-- | qa/spec/page/logging_spec.rb | 18 | ||||
-rw-r--r-- | qa/spec/support/retrier_spec.rb | 12 | ||||
-rw-r--r-- | qa/spec/support/waiter_spec.rb | 4 |
8 files changed, 18 insertions, 37 deletions
diff --git a/qa/qa/flow/login.rb b/qa/qa/flow/login.rb index 5505fabd4ae..30137571dbd 100644 --- a/qa/qa/flow/login.rb +++ b/qa/qa/flow/login.rb @@ -12,6 +12,12 @@ module QA yield + # Workaround for a bug preventing sign out from secondary nodes + # See https://gitlab.com/gitlab-org/gitlab/issues/198289 + if address == :geo_secondary + Runtime::Browser.visit(:geo_primary, Page::Dashboard::Projects) + end + Page::Main::Menu.perform(&:sign_out) end diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index f07d56e85c3..fc460f41a36 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -26,13 +26,13 @@ module QA wait_for_requests end - def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: false) + def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: true) Support::Waiter.wait_until(max_duration: max_duration, sleep_interval: sleep_interval, raise_on_failure: raise_on_failure) do yield || (reload && refresh && false) end end - def retry_until(max_attempts: 3, reload: false, sleep_interval: 0, raise_on_failure: false) + def retry_until(max_attempts: 3, reload: false, sleep_interval: 0, raise_on_failure: true) Support::Retrier.retry_until(max_attempts: max_attempts, reload_page: (reload && self), sleep_interval: sleep_interval, raise_on_failure: raise_on_failure) do yield end diff --git a/qa/qa/support/page/logging.rb b/qa/qa/support/page/logging.rb index f59795e17c3..281e1b85cc3 100644 --- a/qa/qa/support/page/logging.rb +++ b/qa/qa/support/page/logging.rb @@ -16,13 +16,6 @@ module QA super end - def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: false) - log("next wait uses reload: #{reload}") - # Logging of wait start/end/duration is handled by QA::Support::Waiter - - super - end - def scroll_to(selector, text: nil) msg = "scrolling to :#{selector}" msg += " with text: #{text}" if text diff --git a/qa/qa/support/retrier.rb b/qa/qa/support/retrier.rb index 7b548e95453..f28534e7c11 100644 --- a/qa/qa/support/retrier.rb +++ b/qa/qa/support/retrier.rb @@ -34,7 +34,7 @@ module QA result end - def retry_until(max_attempts: nil, max_duration: nil, reload_page: nil, sleep_interval: 0, raise_on_failure: false, retry_on_exception: false) + def retry_until(max_attempts: nil, max_duration: nil, reload_page: nil, sleep_interval: 0, raise_on_failure: true, retry_on_exception: false) # For backwards-compatibility max_attempts = 3 if max_attempts.nil? && max_duration.nil? diff --git a/qa/qa/support/waiter.rb b/qa/qa/support/waiter.rb index fe63c930c7c..18ccee80074 100644 --- a/qa/qa/support/waiter.rb +++ b/qa/qa/support/waiter.rb @@ -7,7 +7,7 @@ module QA module_function - def wait_until(max_duration: singleton_class::DEFAULT_MAX_WAIT_TIME, reload_page: nil, sleep_interval: 0.1, raise_on_failure: false, retry_on_exception: false) + def wait_until(max_duration: singleton_class::DEFAULT_MAX_WAIT_TIME, reload_page: nil, sleep_interval: 0.1, raise_on_failure: true, retry_on_exception: false) QA::Runtime::Logger.debug( <<~MSG.tr("\n", ' ') with wait_until: max_duration: #{max_duration}; diff --git a/qa/spec/page/logging_spec.rb b/qa/spec/page/logging_spec.rb index a6b61e9b1ee..f2ce9fb2cf8 100644 --- a/qa/spec/page/logging_spec.rb +++ b/qa/spec/page/logging_spec.rb @@ -27,24 +27,6 @@ describe QA::Support::Page::Logging do .to output(%r{refreshing http://current-url}).to_stdout_from_any_process end - it 'logs wait' do - expect { subject.wait_until(max_duration: 0) {} } - .to output(/next wait uses reload: true/).to_stdout_from_any_process - expect { subject.wait_until(max_duration: 0) {} } - .to output(/with wait_until/).to_stdout_from_any_process - expect { subject.wait_until(max_duration: 0) {} } - .to output(/ended wait_until$/).to_stdout_from_any_process - end - - it 'logs wait with reload false' do - expect { subject.wait_until(max_duration: 0, reload: false) {} } - .to output(/next wait uses reload: false/).to_stdout_from_any_process - expect { subject.wait_until(max_duration: 0, reload: false) {} } - .to output(/with wait_until/).to_stdout_from_any_process - expect { subject.wait_until(max_duration: 0, reload: false) {} } - .to output(/ended wait_until$/).to_stdout_from_any_process - end - it 'logs scroll_to' do expect { subject.scroll_to(:element) } .to output(/scrolling to :element/).to_stdout_from_any_process diff --git a/qa/spec/support/retrier_spec.rb b/qa/spec/support/retrier_spec.rb index fbe66a680f9..ef1d53e6b65 100644 --- a/qa/spec/support/retrier_spec.rb +++ b/qa/spec/support/retrier_spec.rb @@ -14,12 +14,12 @@ describe QA::Support::Retrier do context 'when the condition is true' do it 'logs max attempts (3 by default)' do expect { subject.retry_until { true } } - .to output(/with retry_until: max_attempts: 3; reload_page: ; sleep_interval: 0; raise_on_failure: false; retry_on_exception: false/).to_stdout_from_any_process + .to output(/with retry_until: max_attempts: 3; reload_page: ; sleep_interval: 0; raise_on_failure: true; retry_on_exception: false/).to_stdout_from_any_process end it 'logs max duration' do expect { subject.retry_until(max_duration: 1) { true } } - .to output(/with retry_until: max_duration: 1; reload_page: ; sleep_interval: 0; raise_on_failure: false; retry_on_exception: false/).to_stdout_from_any_process + .to output(/with retry_until: max_duration: 1; reload_page: ; sleep_interval: 0; raise_on_failure: true; retry_on_exception: false/).to_stdout_from_any_process end it 'logs the end' do @@ -30,12 +30,12 @@ describe QA::Support::Retrier do context 'when the condition is false' do it 'logs the start' do - expect { subject.retry_until(max_duration: 0) { false } } + expect { subject.retry_until(max_duration: 0, raise_on_failure: false) { false } } .to output(/with retry_until: max_duration: 0; reload_page: ; sleep_interval: 0; raise_on_failure: false; retry_on_exception: false/).to_stdout_from_any_process end it 'logs the end' do - expect { subject.retry_until(max_duration: 0) { false } } + expect { subject.retry_until(max_duration: 0, raise_on_failure: false) { false } } .to output(/ended retry_until$/).to_stdout_from_any_process end end @@ -54,8 +54,8 @@ describe QA::Support::Retrier do subject.retry_until end - it 'sets raise_on_failure to false by default' do - expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: false)) + it 'sets raise_on_failure to true by default' do + expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: true)) subject.retry_until end diff --git a/qa/spec/support/waiter_spec.rb b/qa/spec/support/waiter_spec.rb index 06e404c862a..40abf0d72a2 100644 --- a/qa/spec/support/waiter_spec.rb +++ b/qa/spec/support/waiter_spec.rb @@ -46,8 +46,8 @@ describe QA::Support::Waiter do subject.wait_until end - it 'sets raise_on_failure to false by default' do - expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: false)) + it 'sets raise_on_failure to true by default' do + expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: true)) subject.wait_until end |