Commit 9ba72fe0 authored by Matija Čupić's avatar Matija Čupić

Change minimum parallel value to 2

parent ff179571
...@@ -28,7 +28,7 @@ module Gitlab ...@@ -28,7 +28,7 @@ module Gitlab
greater_than_or_equal_to: 0, greater_than_or_equal_to: 0,
less_than_or_equal_to: 2 } less_than_or_equal_to: 2 }
validates :parallel, numericality: { only_integer: true, validates :parallel, numericality: { only_integer: true,
greater_than_or_equal_to: 1 } greater_than_or_equal_to: 2 }
validates :when, validates :when,
inclusion: { in: %w[on_success on_failure always manual delayed], inclusion: { in: %w[on_success on_failure always manual delayed],
message: 'should be on_success, on_failure, ' \ message: 'should be on_success, on_failure, ' \
......
...@@ -147,13 +147,13 @@ describe Gitlab::Ci::Config::Entry::Job do ...@@ -147,13 +147,13 @@ describe Gitlab::Ci::Config::Entry::Job do
end end
end end
context 'when it is lower than one' do context 'when it is lower than two' do
let(:config) { { parallel: 0 } } let(:config) { { parallel: 1 } }
it 'returns error about value too low' do it 'returns error about value too low' do
expect(entry).not_to be_valid expect(entry).not_to be_valid
expect(entry.errors) expect(entry.errors)
.to include 'job parallel must be greater than or equal to 1' .to include 'job parallel must be greater than or equal to 2'
end end
end end
......
...@@ -141,11 +141,11 @@ module Gitlab ...@@ -141,11 +141,11 @@ module Gitlab
context 'when parallel is defined' do context 'when parallel is defined' do
let(:config) do let(:config) do
YAML.dump(rspec: { script: 'rspec', YAML.dump(rspec: { script: 'rspec',
parallel: 1 }) parallel: 2 })
end end
it 'has the attributes' do it 'has the attributes' do
expect(subject[:options][:parallel]).to eq 1 expect(subject[:options][:parallel]).to eq 2
end end
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