diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /qa/qa/resource/events | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'qa/qa/resource/events')
-rw-r--r-- | qa/qa/resource/events/base.rb | 7 | ||||
-rw-r--r-- | qa/qa/resource/events/project.rb | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/qa/qa/resource/events/base.rb b/qa/qa/resource/events/base.rb index 91ec0e59e37..4c5f54825b3 100644 --- a/qa/qa/resource/events/base.rb +++ b/qa/qa/resource/events/base.rb @@ -9,9 +9,12 @@ module QA EventNotFoundError = Class.new(RuntimeError) module Base - def events(action: nil) + def events(action: nil, target_type: nil) + query = [] + query << "action=#{CGI.escape(action)}" if action + query << "target_type=#{CGI.escape(target_type)}" if target_type path = [api_get_events] - path << "?action=#{CGI.escape(action)}" if action + path << "?#{query.join("&")}" unless query.empty? parse_body(api_get_from("#{path.join}")) end diff --git a/qa/qa/resource/events/project.rb b/qa/qa/resource/events/project.rb index 99c78254f42..8c97f66c663 100644 --- a/qa/qa/resource/events/project.rb +++ b/qa/qa/resource/events/project.rb @@ -6,6 +6,13 @@ module QA module Project include Events::Base + def wait_for_merge(title) + QA::Runtime::Logger.debug(%Q[#{self.class.name} - wait_for_merge with title "#{title}"]) + wait_for_event do + events(action: 'accepted', target_type: 'merge_request').any? { |event| event[:target_title] == title } + end + end + def wait_for_push(commit_message) QA::Runtime::Logger.debug(%Q[#{self.class.name} - wait_for_push with commit message "#{commit_message}"]) wait_for_event do |