summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-10-27 18:19:58 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-10-27 18:21:32 +0200
commita12da215c96fc15fb27753f18ab2106c6714bbb2 (patch)
tree5548a670fef026d4fb01564adee56fe7cca40efb
parentc2d49565cf787c592c4f8bd9f24843babd2a6c9a (diff)
downloadgitlab-ce-a12da215c96fc15fb27753f18ab2106c6714bbb2.tar.gz
Add YamlProcessor specs
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index 85b23edce9f..544e421d571 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -136,6 +136,19 @@ module Gitlab
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
describe '#stages_attributes' do
@@ -645,6 +658,25 @@ module Gitlab
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
context 'when cache definition has unknown keys' do
it 'raises relevant validation error' do