Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-22 10:39:50 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-22 10:39:50 +0300
commitd16eed3b096bb01efda90dfea47ac549a9d2ffbc (patch)
tree6ee1caeaaf628143f60d86acc11669a84a625ed0 /spec/services/ci/retry_pipeline_service_spec.rb
parent5a84b5fd7c5e281de7fad55a308ff35da64f50ca (diff)
Fix reprocessing skipped jobs when retrying pipeline
Diffstat (limited to 'spec/services/ci/retry_pipeline_service_spec.rb')
-rw-r--r--spec/services/ci/retry_pipeline_service_spec.rb25
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb
index c0af8b8450a..8b1ed6470e4 100644
--- a/spec/services/ci/retry_pipeline_service_spec.rb
+++ b/spec/services/ci/retry_pipeline_service_spec.rb
@@ -69,6 +69,25 @@ describe Ci::RetryPipelineService, '#execute', :services do
end
end
+ context 'when the last stage was skipepd' do
+ before do
+ create_build('build 1', :success, 0)
+ create_build('test 2', :failed, 1)
+ create_build('report 3', :skipped, 2)
+ create_build('report 4', :skipped, 2)
+ end
+
+ it 'retries builds only in the first stage' do
+ service.execute(pipeline)
+
+ expect(build('build 1')).to be_success
+ expect(build('test 2')).to be_pending
+ expect(build('report 3')).to be_created
+ expect(build('report 4')).to be_created
+ expect(pipeline.reload).to be_running
+ end
+ end
+
context 'when pipeline contains manual actions' do
context 'when there is a canceled manual action in first stage' do
before do
@@ -90,14 +109,16 @@ describe Ci::RetryPipelineService, '#execute', :services do
context 'when there is a skipped manual action in last stage' do
before do
create_build('rspec 1', :canceled, 0)
+ create_build('rspec 2', :skipped, 0, :manual)
create_build('staging', :skipped, 1, :manual)
end
- it 'retries canceled job and skips manual action' do
+ it 'retries canceled job and reprocesses manual actions' do
service.execute(pipeline)
expect(build('rspec 1')).to be_pending
- expect(build('staging')).to be_skipped
+ expect(build('rspec 2')).to be_skipped
+ expect(build('staging')).to be_created
expect(pipeline.reload).to be_running
end
end