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