diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-05 03:07:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-05 03:07:41 +0000 |
commit | 98c4335e7052ce29b5c1ba39be1ed04c6cbf8115 (patch) | |
tree | c5d07bf905ef47a32ee1be5e7512b036300b5818 /qa/qa/resource | |
parent | 54cbcea92909e69248abc9e6b92c7d14db3308a5 (diff) | |
download | gitlab-ce-98c4335e7052ce29b5c1ba39be1ed04c6cbf8115.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/resource')
-rw-r--r-- | qa/qa/resource/project.rb | 4 | ||||
-rw-r--r-- | qa/qa/resource/runner.rb | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb index b2b62184837..0928936284a 100644 --- a/qa/qa/resource/project.rb +++ b/qa/qa/resource/project.rb @@ -115,8 +115,8 @@ module QA post_body end - def runners - response = get Runtime::API::Request.new(api_client, api_runners_path).url + def runners(tag_list: nil) + response = get Runtime::API::Request.new(api_client, "#{api_runners_path}?tag_list=#{tag_list.compact.join(',')}").url parse_body(response) end diff --git a/qa/qa/resource/runner.rb b/qa/qa/resource/runner.rb index 102c1ec83f5..d1b4e8f7d54 100644 --- a/qa/qa/resource/runner.rb +++ b/qa/qa/resource/runner.rb @@ -41,7 +41,17 @@ module QA end def remove_via_api! - @id = project.runners.find { |runner| runner[:description] == name }[:id] + runners = project.runners(tag_list: tags) + unless runners && !runners.empty? + raise "Project #{project.path_with_namespace} has no runners with tags #{tags}." + end + + this_runner = runners.find { |runner| runner[:description] == name } + unless this_runner + raise "Project #{project.path_with_namespace} does not have a runner with a description matching #{name} and tags #{tags}. Runners available: #{runners}" + end + + @id = this_runner[:id] super |