Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/yaml_processor_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index c4e27d0e420..f8f1d71e773 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -2675,6 +2675,42 @@ module Gitlab
it_behaves_like 'returns errors', 'jobs:test1 dependencies should be an array of strings'
end
+
+ context 'needs with parallel:matrix' do
+ let(:config) do
+ {
+ build1: {
+ stage: 'build',
+ script: 'build',
+ parallel: { matrix: [{ 'PROVIDER': ['aws'], 'STACK': %w[monitoring app1 app2] }] }
+ },
+ test1: {
+ stage: 'test',
+ script: 'test',
+ needs: [{ job: 'build1', parallel: { matrix: [{ 'PROVIDER': ['aws'], 'STACK': ['app1'] }] } }]
+ }
+ }
+ end
+
+ it "does create jobs with valid specification" do
+ expect(subject.builds.size).to eq(4)
+ expect(subject.builds[3]).to eq(
+ stage: "test",
+ stage_idx: 2,
+ name: "test1",
+ only: { refs: %w[branches tags] },
+ options: { script: ["test"] },
+ needs_attributes: [
+ { name: "build1: [aws, app1]", artifacts: true, optional: false }
+ ],
+ when: "on_success",
+ allow_failure: false,
+ job_variables: [],
+ root_variables_inheritance: true,
+ scheduling_type: :dag
+ )
+ end
+ end
end
context 'with when/rules' do