Commit 1fcc9ad7 authored by Kamil Trzciński's avatar Kamil Trzciński Committed by Dylan Griffith

Fix `register_job_service_spec` failures

parent 8d5d6ada
...@@ -90,7 +90,8 @@ module Ci ...@@ -90,7 +90,8 @@ module Ci
def builds_for_group_runner def builds_for_group_runner
# Workaround for weird Rails bug, that makes `runner.groups.to_sql` to return `runner_id = NULL` # Workaround for weird Rails bug, that makes `runner.groups.to_sql` to return `runner_id = NULL`
groups = Group.joins(:runner_namespaces).where(runner_namespaces: { runner_id: runner }) groups = Group.joins(:runner_namespaces).merge(runner.runner_namespaces)
hierarchy_groups = Gitlab::GroupHierarchy.new(groups).base_and_descendants hierarchy_groups = Gitlab::GroupHierarchy.new(groups).base_and_descendants
projects = Project.where(namespace_id: hierarchy_groups) projects = Project.where(namespace_id: hierarchy_groups)
.with_group_runners_enabled .with_group_runners_enabled
......
...@@ -320,7 +320,7 @@ module Ci ...@@ -320,7 +320,7 @@ module Ci
end end
context 'when access_level of runner is ref_protected' do context 'when access_level of runner is ref_protected' do
let!(:specific_runner) { create(:ci_runner, :ref_protected, :specific) } let!(:specific_runner) { create(:ci_runner, :project, :ref_protected, projects: [project]) }
context 'when a job is protected' do context 'when a job is protected' do
let!(:pending_job) { create(:ci_build, :protected, pipeline: pipeline) } let!(:pending_job) { create(:ci_build, :protected, pipeline: pipeline) }
......
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