From 9ba72fe09aaf3bf903494f09fe8896012e962c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Sat, 27 Oct 2018 19:06:46 +0200 Subject: Change minimum parallel value to 2 --- lib/gitlab/ci/config/entry/job.rb | 2 +- spec/lib/gitlab/ci/config/entry/job_spec.rb | 6 +++--- spec/lib/gitlab/ci/yaml_processor_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index 368b5eb2a89..c73c88583b0 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -28,7 +28,7 @@ module Gitlab greater_than_or_equal_to: 0, less_than_or_equal_to: 2 } validates :parallel, numericality: { only_integer: true, - greater_than_or_equal_to: 1 } + greater_than_or_equal_to: 2 } validates :when, inclusion: { in: %w[on_success on_failure always manual delayed], message: 'should be on_success, on_failure, ' \ diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb index 718098c364e..f1a2946acda 100644 --- a/spec/lib/gitlab/ci/config/entry/job_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb @@ -147,13 +147,13 @@ describe Gitlab::Ci::Config::Entry::Job do end end - context 'when it is lower than one' do - let(:config) { { parallel: 0 } } + context 'when it is lower than two' do + let(:config) { { parallel: 1 } } it 'returns error about value too low' do expect(entry).not_to be_valid 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 diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index 544e421d571..8289a6b000b 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -141,11 +141,11 @@ module Gitlab context 'when parallel is defined' do let(:config) do YAML.dump(rspec: { script: 'rspec', - parallel: 1 }) + parallel: 2 }) end it 'has the attributes' do - expect(subject[:options][:parallel]).to eq 1 + expect(subject[:options][:parallel]).to eq 2 end end end -- cgit v1.2.1