Commit 5f258b0c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch...

Merge branch '55628-artifacts-from-a-job-defined-after-a-parallel-job-are-not-downloaded' into 'master'

Resolve "Artifacts from a job defined after a `parallel` job are NOT downloaded"

Closes #55628

See merge request gitlab-org/gitlab-ce!24273
parents b2e807e6 09dc4956
---
title: Handle regular job dependencies next to parallelized job dependencies.
merge_request: 24273
author:
type: fixed
......@@ -46,7 +46,8 @@ module Gitlab
parallelized_job_names = @parallelized_jobs.keys.map(&:to_s)
parallelized_config.each_with_object({}) do |(job_name, config), hash|
if config[:dependencies] && (intersection = config[:dependencies] & parallelized_job_names).any?
deps = intersection.map { |dep| @parallelized_jobs[dep.to_sym].map(&:first) }.flatten
parallelized_deps = intersection.map { |dep| @parallelized_jobs[dep.to_sym].map(&:first) }.flatten
deps = config[:dependencies] - intersection + parallelized_deps
hash[job_name] = config.merge(dependencies: deps)
else
hash[job_name] = config
......
......@@ -62,5 +62,25 @@ describe Gitlab::Ci::Config::Normalizer do
expect(subject[:other_job][:dependencies]).not_to include(job_name)
end
end
context 'when there are dependencies which are both parallelized and not' do
let(:config) do
{
job_name => job_config,
other_job: { script: 'echo 1' },
final_job: { script: 'echo 1', dependencies: [job_name.to_s, "other_job"] }
}
end
it 'parallelizes dependencies' do
job_names = ["rspec 1/5", "rspec 2/5", "rspec 3/5", "rspec 4/5", "rspec 5/5"]
expect(subject[:final_job][:dependencies]).to include(*job_names)
end
it 'includes the regular job in dependencies' do
expect(subject[:final_job][:dependencies]).to include('other_job')
end
end
end
end
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