diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-05 12:10:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-05 12:10:33 +0000 |
commit | 023e050d82ed11d9060ce5bdaec99c3871b98164 (patch) | |
tree | ee89e2c83c2771c635a0c1daaa88fcce25f18612 /spec/lib/gitlab/ci/pipeline/chain | |
parent | 1c568d834d0cbe1bbbf558ac9a45940f6dbda37a (diff) | |
download | gitlab-ce-023e050d82ed11d9060ce5bdaec99c3871b98164.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/chain')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb index e4768f2ef0d..ae427eaf403 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb @@ -21,17 +21,37 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Skip do before do allow(pipeline).to receive(:git_commit_message) .and_return('commit message [ci skip]') - - step.perform! end it 'breaks the chain' do + step.perform! + expect(step.break?).to be true end it 'skips the pipeline' do + step.perform! + expect(pipeline.reload).to be_skipped end + + it 'calls ensure_project_iid explicitly' do + expect(pipeline).to receive(:ensure_project_iid!) + + step.perform! + end + + context 'when the ci_pipeline_ensure_iid_on_save feature flag is off' do + before do + stub_feature_flags(ci_pipeline_ensure_iid_on_skip: false) + end + + it 'does not call ensure_project_iid explicitly' do + expect(pipeline).not_to receive(:ensure_project_iid!) + + step.perform! + end + end end context 'when pipeline has not been skipped' do |