Commit 7901b61c authored by Sofia Vistas's avatar Sofia Vistas

Refactor tests to use group token instead of sandbox

Prior to this change, the package tests that
use the group endpoint have a sandbox runner
assigned to process the jobs at the group level.
This caused the removal of the runner to be flaky
since there can be too many runners on the general
sanbox.

This change scopes the runner to the group level
avoiding to have all the sandbox runners visible at
the project level
parent 9fd32bec
......@@ -47,6 +47,12 @@ module QA
resource_web_url(api_get)
rescue ResourceNotFoundError
super
Support::Retrier.retry_on_exception(sleep_interval: 5) do
resource = resource_web_url(api_get)
populate(:runners_token)
resource
end
end
def api_get_path
......
......@@ -44,7 +44,7 @@ module QA
runner.name = "qa-runner-#{Time.now.to_i}"
runner.tags = ["runner-for-#{project.group.name}"]
runner.executor = :docker
runner.token = project.group.sandbox.runners_token
runner.token = project.group.runners_token
end
end
......
......@@ -37,7 +37,7 @@ module QA
runner.name = "qa-runner-#{Time.now.to_i}"
runner.tags = ["runner-for-#{project.group.name}"]
runner.executor = :docker
runner.token = project.group.sandbox.runners_token
runner.token = project.group.runners_token
end
end
......
......@@ -31,9 +31,9 @@ module QA
let!(:runner) do
Resource::Runner.fabricate! do |runner|
runner.name = "qa-runner-#{Time.now.to_i}"
runner.tags = ["runner-for-#{project.group.sandbox.name}"]
runner.tags = ["runner-for-#{project.group.name}"]
runner.executor = :docker
runner.token = project.group.sandbox.runners_token
runner.token = project.group.runners_token
end
end
......@@ -69,7 +69,7 @@ module QA
only:
- "#{project.default_branch}"
tags:
- "runner-for-#{project.group.sandbox.name}"
- "runner-for-#{project.group.name}"
YAML
}
]
......@@ -128,7 +128,7 @@ module QA
only:
- "#{another_project.default_branch}"
tags:
- "runner-for-#{project.group.sandbox.name}"
- "runner-for-#{project.group.name}"
YAML
}
]
......@@ -145,7 +145,7 @@ module QA
expect(job).to be_successful(timeout: 800)
end
project.group.sandbox.visit!
project.group.visit!
Page::Group::Menu.perform(&:go_to_group_packages)
......
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