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
Boxiang Sun
gitlab-ce
Commits
d883fe1c
Commit
d883fe1c
authored
Apr 04, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add success CI Build empty state status
parent
75f8a45f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
1 deletion
+72
-1
lib/gitlab/ci/status/build/factory.rb
lib/gitlab/ci/status/build/factory.rb
+2
-1
lib/gitlab/ci/status/build/success.rb
lib/gitlab/ci/status/build/success.rb
+21
-0
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+16
-0
spec/lib/gitlab/ci/status/build/success_spec.rb
spec/lib/gitlab/ci/status/build/success_spec.rb
+33
-0
No files found.
lib/gitlab/ci/status/build/factory.rb
View file @
d883fe1c
...
...
@@ -8,7 +8,8 @@ module Gitlab
Status
::
Build
::
Canceled
,
Status
::
Build
::
Created
,
Status
::
Build
::
Pending
,
Status
::
Build
::
Skipped
],
Status
::
Build
::
Skipped
,
Status
::
Build
::
Success
],
[
Status
::
Build
::
Cancelable
,
Status
::
Build
::
Retryable
],
[
Status
::
Build
::
FailedAllowed
,
...
...
lib/gitlab/ci/status/build/success.rb
0 → 100644
View file @
d883fe1c
module
Gitlab
module
Ci
module
Status
module
Build
class
Success
<
Status
::
Extended
def
illustration
{
image:
'illustrations/skipped-job_empty.svg'
,
size:
'svg-430'
,
title:
_
(
'Job has been erased'
)
}
end
def
self
.
matches?
(
build
,
user
)
build
.
success?
end
end
end
end
end
end
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
d883fe1c
...
...
@@ -36,6 +36,22 @@ describe Gitlab::Ci::Status::Build::Factory do
expect
(
status
).
to
have_details
expect
(
status
).
to
have_action
end
context
'when job log gets erased'
do
before
do
build
.
trace
.
set
(
nil
)
end
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Success
,
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
]
end
it
'fabricates a retryable build status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
end
end
end
context
'when build is failed'
do
...
...
spec/lib/gitlab/ci/status/build/success_spec.rb
0 → 100644
View file @
d883fe1c
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Success
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
described_class
.
new
(
double
(
'subject'
))
end
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
}
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build succeeded'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build did not succeed'
do
let
(
:build
)
{
create
(
:ci_build
,
:skipped
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
end
end
end
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