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:
-rw-r--r--app/models/concerns/has_status.rb1
-rw-r--r--spec/services/ci/process_pipeline_service_spec.rb19
2 files changed, 19 insertions, 1 deletions
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb
index 5a6c2725354..582fe8bb1a7 100644
--- a/app/models/concerns/has_status.rb
+++ b/app/models/concerns/has_status.rb
@@ -72,6 +72,7 @@ module HasStatus
quoted_when = connection.quote_column_name('when')
# We want to ignore skipped manual jobs
where("#{quoted_when} <> ? OR status <> ?", 'manual', 'skipped').
+ # We want to ignore skipped on_failure
where("#{quoted_when} <> ? OR status <> ?", 'on_failure', 'skipped')
end
end
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,