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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
6053acf5
Commit
6053acf5
authored
Sep 30, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We consider skipped = success, fixes #22598
parent
385c602b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+49
-0
No files found.
app/models/concerns/has_status.rb
View file @
6053acf5
...
...
@@ -21,7 +21,7 @@ module HasStatus
deduce_status
=
"(CASE
WHEN (
#{
builds
}
)=(
#{
created
}
) THEN 'created'
WHEN (
#{
builds
}
)=(
#{
skipped
}
) THEN 's
kipped
'
WHEN (
#{
builds
}
)=(
#{
skipped
}
) THEN 's
uccess
'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'success'
WHEN (
#{
builds
}
)=(
#{
created
}
)+(
#{
pending
}
)+(
#{
skipped
}
) THEN 'pending'
WHEN (
#{
builds
}
)=(
#{
canceled
}
)+(
#{
success
}
)+(
#{
ignored
}
)+(
#{
skipped
}
) THEN 'canceled'
...
...
spec/services/ci/process_pipeline_service_spec.rb
View file @
6053acf5
...
...
@@ -230,6 +230,55 @@ describe Ci::ProcessPipelineService, services: true do
end
end
context
'when there are manual jobs in earlier stages'
do
before
do
builds
process_pipeline
builds
.
each
(
&
:reload
)
end
context
'when first stage has only manual jobs'
do
let
(
:builds
)
do
[
create_build
(
'build'
,
0
,
'manual'
),
create_build
(
'check'
,
1
),
create_build
(
'test'
,
2
)]
end
it
'starts from the second stage'
do
expect
(
builds
.
map
(
&
:status
)).
to
contain_exactly
(
'skipped'
,
'pending'
,
'created'
)
end
end
context
'when second stage has only manual jobs'
do
let
(
:builds
)
do
[
create_build
(
'check'
,
0
),
create_build
(
'build'
,
1
,
'manual'
),
create_build
(
'test'
,
2
)]
end
it
'skips second stage and continues on third stage'
do
expect
(
builds
.
map
(
&
:status
)).
to
contain_exactly
(
'pending'
,
'created'
,
'created'
)
builds
.
first
.
success
builds
.
each
(
&
:reload
)
expect
(
builds
.
map
(
&
:status
)).
to
contain_exactly
(
'success'
,
'skipped'
,
'pending'
)
end
end
def
create_build
(
name
,
stage_idx
,
when_value
=
nil
)
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
name
,
stage_idx:
stage_idx
,
when:
when_value
)
end
end
context
'when failed build in the middle stage is retried'
do
context
'when failed build is the only unsuccessful build in the stage'
do
before
do
...
...
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