Commit 294bddf9 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use runner tags when processing CI/CD QA pipelines

parent 5cb94835
......@@ -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
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment