BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bdb86ea6
Commit
bdb86ea6
authored
Apr 18, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render canceled status if any of the jobs canceled
This status will be returned only when there are no failed jobs that are not allowed to fail.
parent
c01ff1f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
statuseable.rb
app/models/concerns/statuseable.rb
+1
-1
statuseable_spec.rb
spec/models/concerns/statuseable_spec.rb
+26
-0
No files found.
app/models/concerns/statuseable.rb
View file @
bdb86ea6
...
...
@@ -18,7 +18,7 @@ module Statuseable
WHEN (
#{
builds
}
)=0 THEN NULL
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
ignored
}
) THEN 'success'
WHEN (
#{
builds
}
)=(
#{
pending
}
) THEN 'pending'
WHEN (
#{
builds
}
)=(
#{
canceled
}
) THEN 'canceled'
WHEN (
#{
builds
}
)=(
#{
canceled
}
)
+(
#{
success
}
)+(
#{
ignored
}
)
THEN 'canceled'
WHEN (
#{
builds
}
)=(
#{
skipped
}
) THEN 'skipped'
WHEN (
#{
running
}
)+(
#{
pending
}
)>0 THEN 'running'
ELSE 'failed'
...
...
spec/models/concerns/statuseable_spec.rb
View file @
bdb86ea6
...
...
@@ -61,9 +61,35 @@ describe Statuseable do
let
(
:statuses
)
do
[
create
(
type
,
status: :success
),
create
(
type
,
status: :canceled
)]
end
it
{
is_expected
.
to
eq
'canceled'
}
end
context
'one failed and one canceled'
do
let
(
:statuses
)
do
[
create
(
type
,
status: :failed
),
create
(
type
,
status: :canceled
)]
end
it
{
is_expected
.
to
eq
'failed'
}
end
context
'one failed but allowed to fail and one canceled'
do
let
(
:statuses
)
do
[
create
(
type
,
status: :failed
,
allow_failure:
true
),
create
(
type
,
status: :canceled
)]
end
it
{
is_expected
.
to
eq
'canceled'
}
end
context
'one running one canceled'
do
let
(
:statuses
)
do
[
create
(
type
,
status: :running
),
create
(
type
,
status: :canceled
)]
end
it
{
is_expected
.
to
eq
'running'
}
end
context
'all canceled'
do
let
(
:statuses
)
do
[
create
(
type
,
status: :canceled
),
create
(
type
,
status: :canceled
)]
...
...
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