diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-08 13:18:32 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-08 13:22:07 +0300 |
commit | 694f31dd40b7bfcdab57f40802df715961f1cbe6 (patch) | |
tree | 020111c754257886502a9c8f4f9f7b8d52e6d262 /spec/services/ci | |
parent | 62b0eb2c0ba02d2a9c9515722dfcb7ec61b7fc6a (diff) |
Fix skipped manual actions issue in pipeline processing
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/process_pipeline_service_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb index cf773866a6f..1d0a28210fb 100644 --- a/spec/services/ci/process_pipeline_service_spec.rb +++ b/spec/services/ci/process_pipeline_service_spec.rb @@ -268,6 +268,24 @@ describe Ci::ProcessPipelineService, '#execute', :services do end end + context 'when there are only manual actions in stages' do + before do + create_build('image', stage_idx: 0, when: 'manual', allow_failure: true) + create_build('build', stage_idx: 1, when: 'manual', allow_failure: true) + create_build('deploy', stage_idx: 2, when: 'manual') + create_build('check', stage_idx: 3) + + process_pipeline + end + + it 'processes all jobs until blocking actions encountered' do + expect(all_builds_statuses).to eq(%w[manual manual manual created]) + expect(all_builds_names).to eq(%w[image build deploy check]) + + expect(pipeline.reload).to be_blocked + end + end + context 'when blocking manual actions are defined' do before do create_build('code:test', stage_idx: 0) @@ -441,6 +459,10 @@ describe Ci::ProcessPipelineService, '#execute', :services do builds.pluck(:name) end + def all_builds_names + all_builds.pluck(:name) + end + def builds_statuses builds.pluck(:status) end |