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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:32 +0300
commitc158fa8d69c704663d289341a014c44c062cda88 (patch)
treed0cac82a9ac9e9ad28bb0030266eb8d5dc91fbbc /spec/lib/gitlab/ci
parentb806264d29b8d52ccb78a41dcc3d67f2b040700c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index 9dea74f6345..058afddd73f 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -1735,6 +1735,39 @@ module Gitlab
it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1 dependencies the build2 should be part of needs') }
end
+
+ context 'needs with a Hash type and dependencies with a string type that are mismatching' do
+ let(:needs) do
+ [
+ "build1",
+ { job: "build2" }
+ ]
+ end
+ let(:dependencies) { %w(build3) }
+
+ it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1 dependencies the build3 should be part of needs') }
+ end
+
+ context 'needs with an array type and dependency with a string type' do
+ let(:needs) { %w(build1) }
+ let(:dependencies) { 'deploy' }
+
+ it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1 dependencies should be an array of strings') }
+ end
+
+ context 'needs with a string type and dependency with an array type' do
+ let(:needs) { 'build1' }
+ let(:dependencies) { %w(deploy) }
+
+ it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1:needs config can only be a hash or an array') }
+ end
+
+ context 'needs with a Hash type and dependency with a string type' do
+ let(:needs) { { job: 'build1' } }
+ let(:dependencies) { 'deploy' }
+
+ it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1 dependencies should be an array of strings') }
+ end
end
context 'with when/rules conflict' do