From 036c9c58ba04046241a2183ec98ad84fcfd0a5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Thu, 8 Nov 2018 10:34:26 +0100 Subject: Limit parallel to 100 This prevents some of the abusive behaviors, of someone putting 100000 and creating out of memory condition easily --- spec/lib/gitlab/ci/config/entry/job_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec') diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb index ac9b0c674a5..57d4577a90c 100644 --- a/spec/lib/gitlab/ci/config/entry/job_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb @@ -118,6 +118,16 @@ describe Gitlab::Ci::Config::Entry::Job do end end + context 'when it is bigger than 50' do + let(:config) { { parallel: 51 } } + + it 'returns error about value too high' do + expect(entry).not_to be_valid + expect(entry.errors) + .to include 'job parallel must be less than or equal to 50' + end + end + context 'when it is not an integer' do let(:config) { { parallel: 1.5 } } -- cgit v1.2.1