Commit 80c463d9 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Extend pipeline retry specs with blocking actions

parent b782358f
...@@ -89,20 +89,59 @@ describe Ci::RetryPipelineService, '#execute', :services do ...@@ -89,20 +89,59 @@ describe Ci::RetryPipelineService, '#execute', :services do
end end
context 'when pipeline contains manual actions' do context 'when pipeline contains manual actions' do
context 'when there is a canceled manual action in first stage' do context 'when there are optional manual actions only' do
before do context 'when there is a canceled manual action in first stage' do
create_build('rspec 1', :failed, 0) before do
create_build('staging', :canceled, 0, when: :manual, allow_failure: true) create_build('rspec 1', :failed, 0)
create_build('rspec 2', :canceled, 1) create_build('staging', :canceled, 0, when: :manual, allow_failure: true)
create_build('rspec 2', :canceled, 1)
end
it 'retries failed builds and marks subsequent for processing' do
service.execute(pipeline)
expect(build('rspec 1')).to be_pending
expect(build('staging')).to be_manual
expect(build('rspec 2')).to be_created
expect(pipeline.reload).to be_running
end
end end
end
it 'retries builds failed builds and marks subsequent for processing' do context 'when pipeline has blocking manual actions defined' do
service.execute(pipeline) context 'when pipeline retry should enqueue builds' do
before do
create_build('test', :failed, 0)
create_build('deploy', :canceled, 0, when: :manual, allow_failure: false)
create_build('verify', :canceled, 1)
end
it 'retries failed builds' do
service.execute(pipeline)
expect(build('test')).to be_pending
expect(build('deploy')).to be_manual
expect(build('verify')).to be_created
expect(pipeline.reload).to be_running
end
end
expect(build('rspec 1')).to be_pending context 'when pipeline retry should block pipeline immediately' do
expect(build('staging')).to be_manual before do
expect(build('rspec 2')).to be_created create_build('test', :success, 0)
expect(pipeline.reload).to be_running create_build('deploy:1', :success, 1, when: :manual, allow_failure: false)
create_build('deploy:2', :failed, 1, when: :manual, allow_failure: false)
create_build('verify', :canceled, 2)
end
it 'reprocesses blocking manual action and blocks pipeline' do
service.execute(pipeline)
expect(build('deploy:1')).to be_success
expect(build('deploy:2')).to be_manual
expect(build('verify')).to be_created
expect(pipeline.reload).to be_blocked
end
end end
end end
......
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