summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/config/entry/job_spec.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-11-08 10:34:26 +0100
committerKamil Trzciński <ayufan@ayufan.eu>2018-11-08 11:58:54 +0100
commit036c9c58ba04046241a2183ec98ad84fcfd0a5bf (patch)
tree99f47fe15bd0aff26e8676a70e76755ceefe5fbe /spec/lib/gitlab/ci/config/entry/job_spec.rb
parentb3b9817e5100ae2e827794d87ac6a6649571eddc (diff)
downloadgitlab-ce-036c9c58ba04046241a2183ec98ad84fcfd0a5bf.tar.gz
Limit parallel to 100limit-parallel-to-100
This prevents some of the abusive behaviors, of someone putting 100000 and creating out of memory condition easily
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/job_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/entry/job_spec.rb10
1 files changed, 10 insertions, 0 deletions
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 } }