diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/services/ci/retry_pipeline_service_spec.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/services/ci/retry_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/retry_pipeline_service_spec.rb | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index 96437290ae3..77345096537 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -5,14 +5,16 @@ require 'spec_helper' RSpec.describe Ci::RetryPipelineService, '#execute' do include ProjectForksHelper - let(:user) { create(:user) } - let(:project) { create(:project) } + let_it_be_with_refind(:user) { create(:user) } + let_it_be_with_refind(:project) { create(:project) } + let(:pipeline) { create(:ci_pipeline, project: project) } - let(:service) { described_class.new(project, user) } let(:build_stage) { create(:ci_stage, name: 'build', position: 0, pipeline: pipeline) } let(:test_stage) { create(:ci_stage, name: 'test', position: 1, pipeline: pipeline) } let(:deploy_stage) { create(:ci_stage, name: 'deploy', position: 2, pipeline: pipeline) } + subject(:service) { described_class.new(project, user) } + context 'when user has full ability to modify pipeline' do before do project.add_developer(user) @@ -272,6 +274,21 @@ RSpec.describe Ci::RetryPipelineService, '#execute' do expect(pipeline.reload).to be_running end end + + context 'when there is a failed manual action' do + before do + create_build('rspec', :success, build_stage) + create_build('manual-rspec', :failed, build_stage, when: :manual, allow_failure: true) + end + + it 'processes the manual action' do + service.execute(pipeline) + + expect(build('rspec')).to be_success + expect(build('manual-rspec')).to be_manual + expect(pipeline.reload).to be_success + end + end end it 'closes all todos about failed jobs for pipeline' do |