summaryrefslogtreecommitdiff
path: root/spec/services/ci/process_pipeline_service_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-01 14:38:39 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-10-01 14:38:39 +0800
commitf0002da09c0f8ae4fb9f732c2e225c9affd98b04 (patch)
treeb0d62e75c40d06c7a956d1f756b11cd139b6f7c1 /spec/services/ci/process_pipeline_service_spec.rb
parent33bbfd277b94ecdf3cb8ffdfc973bbfb67b54810 (diff)
downloadgitlab-ce-f0002da09c0f8ae4fb9f732c2e225c9affd98b04.tar.gz
Add a test for on_failure jobs in the middle
Diffstat (limited to 'spec/services/ci/process_pipeline_service_spec.rb')
-rw-r--r--spec/services/ci/process_pipeline_service_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb
index 95bdb43db05..ff113efd916 100644
--- a/spec/services/ci/process_pipeline_service_spec.rb
+++ b/spec/services/ci/process_pipeline_service_spec.rb
@@ -230,7 +230,7 @@ describe Ci::ProcessPipelineService, services: true do
end
end
- context 'when there are manual jobs in earlier stages' do
+ context 'when there are manual/on_failure jobs in earlier stages' do
before do
builds
process_pipeline
@@ -266,6 +266,23 @@ describe Ci::ProcessPipelineService, services: true do
end
end
+ context 'when second stage has only on_failure jobs' do
+ let(:builds) do
+ [create_build('check', 0),
+ create_build('build', 1, 'on_failure'),
+ create_build('test', 2)]
+ end
+
+ it 'skips second stage and continues on third stage' do
+ expect(builds.map(&:status)).to eq(%w[pending created created])
+
+ builds.first.success
+ builds.each(&:reload)
+
+ expect(builds.map(&:status)).to eq(%w[success skipped pending])
+ end
+ end
+
def create_build(name, stage_idx, when_value = nil)
create(:ci_build,
:created,