diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-05 12:56:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-05 12:56:47 +0300 |
commit | 50a34b230b390fbd0e65c79c3daf377bc0faa8e4 (patch) | |
tree | bc69edade1ee2f1948591da6cec87d4d7b3df93a /spec | |
parent | 825350a6569f90d5aef281cf977acf60b8f56b8f (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/ci/create_downstream_pipeline_service_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/ci/create_downstream_pipeline_service_spec.rb b/spec/services/ci/create_downstream_pipeline_service_spec.rb index 6da6ec3379a..152f408c9f8 100644 --- a/spec/services/ci/create_downstream_pipeline_service_spec.rb +++ b/spec/services/ci/create_downstream_pipeline_service_spec.rb @@ -894,4 +894,22 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute', feature_category end end end + + context 'when downstream pipeline creation fails with unexpected errors', :aggregate_failures do + before do + downstream_project.add_developer(user) + + allow(::Ci::CreatePipelineService).to receive(:new) + .and_raise(RuntimeError, 'undefined failure') + end + + it 'drops the bridge without creating a pipeline' do + expect { subject } + .to raise_error(RuntimeError, /undefined failure/) + .and change { Ci::Pipeline.count }.by(0) + + expect(bridge.reload).to be_failed + expect(bridge.failure_reason).to eq('data_integrity_failure') + end + end end |