Return untouched hash if no job is parallelized
This commit is contained in:
parent
e7df959b8f
commit
126fbe580f
|
@ -9,14 +9,16 @@ module Gitlab
|
|||
end
|
||||
|
||||
def normalize_jobs
|
||||
extract_parallelized_jobs
|
||||
extract_parallelized_jobs!
|
||||
return @jobs_config if @parallelized_jobs.empty?
|
||||
|
||||
parallelized_config = parallelize_jobs
|
||||
parallelize_dependencies(parallelized_config)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def extract_parallelized_jobs
|
||||
def extract_parallelized_jobs!
|
||||
@parallelized_jobs = {}
|
||||
|
||||
@jobs_config.each do |job_name, config|
|
||||
|
|
|
@ -31,6 +31,14 @@ describe Gitlab::Ci::Config::Normalizer do
|
|||
expect(configs).to all(eq(original_config))
|
||||
end
|
||||
|
||||
context 'when the job is not parallelized' do
|
||||
let(:job_config) { { script: 'rspec', name: 'rspec' } }
|
||||
|
||||
it 'returns the same hash' do
|
||||
is_expected.to eq(config)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when there is a job with a slash in it' do
|
||||
let(:job_name) { :"rspec 35/2" }
|
||||
|
||||
|
|
Loading…
Reference in New Issue