Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f0002da0
Commit
f0002da0
authored
Oct 01, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for on_failure jobs in the middle
parent
33bbfd27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-0
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+18
-1
No files found.
app/models/concerns/has_status.rb
View file @
f0002da0
...
...
@@ -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
...
...
spec/services/ci/process_pipeline_service_spec.rb
View file @
f0002da0
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment