diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-23 12:10:18 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-23 12:13:59 +0100 |
commit | 294bddf95c646e08f68aeec16024b48e18dd3ba2 (patch) | |
tree | c58541e2a01ce47229a65b8e8be7292d41ee9039 /qa | |
parent | 5cb94835c0010d1954b26c858f910d533cd88e38 (diff) | |
download | gitlab-ce-294bddf95c646e08f68aeec16024b48e18dd3ba2.tar.gz |
Use runner tags when processing CI/CD QA pipelines
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/factory/resource/runner.rb | 8 | ||||
-rw-r--r-- | qa/qa/specs/features/project/pipelines_spec.rb | 10 |
2 files changed, 16 insertions, 2 deletions
diff --git a/qa/qa/factory/resource/runner.rb b/qa/qa/factory/resource/runner.rb index 299a9d0716d..109e2e59fcc 100644 --- a/qa/qa/factory/resource/runner.rb +++ b/qa/qa/factory/resource/runner.rb @@ -4,7 +4,7 @@ module QA module Factory module Resource class Runner < Factory::Base - attr_writer :name + attr_writer :name, :tags dependency Factory::Resource::Project, as: :project do |project| project.name = 'project-with-ci-cd' @@ -15,6 +15,10 @@ module QA @name || "qa-runner-#{SecureRandom.hex(4)}" end + def tags + @tags || %w[qa e2e] + end + def fabricate! project.visit! @@ -26,7 +30,7 @@ module QA runner.pull runner.token = runners.registration_token runner.address = runners.coordinator_address - runner.tags = %w[qa test] + runner.tags = tags runner.register! # TODO, wait for runner to register using non-blocking method. sleep 5 diff --git a/qa/qa/specs/features/project/pipelines_spec.rb b/qa/qa/specs/features/project/pipelines_spec.rb index f9280cd049a..3a6c93cd903 100644 --- a/qa/qa/specs/features/project/pipelines_spec.rb +++ b/qa/qa/specs/features/project/pipelines_spec.rb @@ -36,6 +36,7 @@ module QA Factory::Resource::Runner.fabricate! do |runner| runner.project = project runner.name = executor + runner.tags = %w[qa test] end Factory::Repository::Push.fabricate! do |push| @@ -44,14 +45,23 @@ module QA push.commit_message = 'Add .gitlab-ci.yml' push.file_content = <<~EOF echo-success-test: + tags: + - qa + - test script: echo 'OK' echo-failure-test: + tags: + - qa + - test script: - echo 'FAILURE' - exit 1 echo-artifacts-test: + tags: + - qa + - test script: echo "CONTENTS" > my-artifacts/artifact.txt artifacts: paths: |