summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/pipeline
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-08-16 14:47:05 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-08-16 14:47:05 +0000
commit535c2d3c71c1cc623958a48f429a88ecaafb2702 (patch)
tree508aa3b90978951b1f8470ac3d7d2101ec64e56a /spec/lib/gitlab/ci/pipeline
parent94c7a93dcae1a0e865d11df00ac24add676b636b (diff)
parent16084ee9d3fdfc333a113e4cbcd3f6d2fc402628 (diff)
downloadgitlab-ce-535c2d3c71c1cc623958a48f429a88ecaafb2702.tar.gz
Merge branch 'mc/feature/pipeline-tracking-config-ce' into 'master'
Add `needs:` CI config option CE Closes gitlab-ee#12334 See merge request gitlab-org/gitlab-ce!31346
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline')
-rw-r--r--spec/lib/gitlab/ci/pipeline/seed/build_spec.rb24
1 files changed, 20 insertions, 4 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/seed/build_spec.rb b/spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
index 5d4dec5899a..1a9350d68bd 100644
--- a/spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
@@ -20,20 +20,36 @@ describe Gitlab::Ci::Pipeline::Seed::Build do
describe '#bridge?' do
subject { seed_build.bridge? }
- context 'when job is a bridge' do
+ context 'when job is a downstream bridge' do
let(:attributes) do
{ name: 'rspec', ref: 'master', options: { trigger: 'my/project' } }
end
it { is_expected.to be_truthy }
+
+ context 'when trigger definition is empty' do
+ let(:attributes) do
+ { name: 'rspec', ref: 'master', options: { trigger: '' } }
+ end
+
+ it { is_expected.to be_falsey }
+ end
end
- context 'when trigger definition is empty' do
+ context 'when job is an upstream bridge' do
let(:attributes) do
- { name: 'rspec', ref: 'master', options: { trigger: '' } }
+ { name: 'rspec', ref: 'master', options: { bridge_needs: { pipeline: 'my/project' } } }
end
- it { is_expected.to be_falsey }
+ it { is_expected.to be_truthy }
+
+ context 'when upstream definition is empty' do
+ let(:attributes) do
+ { name: 'rspec', ref: 'master', options: { bridge_needs: { pipeline: '' } } }
+ end
+
+ it { is_expected.to be_falsey }
+ end
end
context 'when job is not a bridge' do