Commit a12da215 authored by Matija Čupić's avatar Matija Čupić

Add YamlProcessor specs

parent c2d49565
...@@ -136,6 +136,19 @@ module Gitlab ...@@ -136,6 +136,19 @@ module Gitlab
end end
end end
end end
describe 'parallel entry' do
context 'when parallel is defined' do
let(:config) do
YAML.dump(rspec: { script: 'rspec',
parallel: 1 })
end
it 'has the attributes' do
expect(subject[:options][:parallel]).to eq 1
end
end
end
end end
describe '#stages_attributes' do describe '#stages_attributes' do
...@@ -645,6 +658,25 @@ module Gitlab ...@@ -645,6 +658,25 @@ module Gitlab
end end
end end
describe 'Parallel' do
context 'when job is parallelized' do
let(:parallel) { 5 }
let(:config) do
YAML.dump(rspec: { script: 'rspec',
parallel: parallel })
end
it 'returns parallelized job' do
config_processor = Gitlab::Ci::YamlProcessor.new(config)
builds = config_processor.stage_builds_attributes("test")
expect(builds.size).to eq(1)
expect(builds.first[:options][:parallel]).to eq(parallel)
end
end
end
describe 'cache' do describe 'cache' do
context 'when cache definition has unknown keys' do context 'when cache definition has unknown keys' do
it 'raises relevant validation error' do it 'raises relevant validation error' do
......
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