BigW Consortium Gitlab

Commit 057a8b70 by Grzegorz Bizon

Add test for head pipeline assignment when skipped

Closes gitlab-org/gitlab-ce#34415
parent 835bdcb8
...@@ -133,6 +133,26 @@ describe Ci::CreatePipelineService do ...@@ -133,6 +133,26 @@ describe Ci::CreatePipelineService do
expect(merge_request.reload.head_pipeline).to eq head_pipeline expect(merge_request.reload.head_pipeline).to eq head_pipeline
end end
end end
context 'when pipeline has been skipped' do
before do
allow_any_instance_of(Ci::Pipeline)
.to receive(:git_commit_message)
.and_return('some commit [ci skip]')
end
it 'updates merge request head pipeline' do
merge_request = create(:merge_request, source_branch: 'master',
target_branch: 'feature',
source_project: project)
head_pipeline = execute_service
expect(head_pipeline).to be_skipped
expect(head_pipeline).to be_persisted
expect(merge_request.reload.head_pipeline).to eq head_pipeline
end
end
end end
context 'auto-cancel enabled' do context 'auto-cancel enabled' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment