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
f379e1b3
Commit
f379e1b3
authored
Apr 05, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename success to erased empty state spec
parent
00b45348
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
22 deletions
+31
-22
lib/gitlab/ci/status/build/erased.rb
lib/gitlab/ci/status/build/erased.rb
+2
-2
lib/gitlab/ci/status/build/factory.rb
lib/gitlab/ci/status/build/factory.rb
+1
-1
spec/lib/gitlab/ci/status/build/erased_spec.rb
spec/lib/gitlab/ci/status/build/erased_spec.rb
+5
-7
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+23
-12
No files found.
lib/gitlab/ci/status/build/
success
.rb
→
lib/gitlab/ci/status/build/
erased
.rb
View file @
f379e1b3
...
@@ -2,7 +2,7 @@ module Gitlab
...
@@ -2,7 +2,7 @@ module Gitlab
module
Ci
module
Ci
module
Status
module
Status
module
Build
module
Build
class
Success
<
Status
::
Extended
class
Erased
<
Status
::
Extended
def
illustration
def
illustration
{
{
image:
'illustrations/skipped-job_empty.svg'
,
image:
'illustrations/skipped-job_empty.svg'
,
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
end
end
def
self
.
matches?
(
build
,
user
)
def
self
.
matches?
(
build
,
user
)
!
build
.
has_trace?
&&
build
.
success
?
build
.
erased
?
end
end
end
end
end
end
...
...
lib/gitlab/ci/status/build/factory.rb
View file @
f379e1b3
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
Status
::
Build
::
Created
,
Status
::
Build
::
Created
,
Status
::
Build
::
Pending
,
Status
::
Build
::
Pending
,
Status
::
Build
::
Skipped
,
Status
::
Build
::
Skipped
,
Status
::
Build
::
Success
],
Status
::
Build
::
Erased
],
[
Status
::
Build
::
Cancelable
,
[
Status
::
Build
::
Cancelable
,
Status
::
Build
::
Retryable
],
Status
::
Build
::
Retryable
],
[
Status
::
Build
::
FailedAllowed
,
[
Status
::
Build
::
FailedAllowed
,
...
...
spec/lib/gitlab/ci/status/build/
success
_spec.rb
→
spec/lib/gitlab/ci/status/build/
erased
_spec.rb
View file @
f379e1b3
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Success
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Erased
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
do
subject
do
...
@@ -14,18 +14,16 @@ describe Gitlab::Ci::Status::Build::Success do
...
@@ -14,18 +14,16 @@ describe Gitlab::Ci::Status::Build::Success do
describe
'.matches?'
do
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build
succeeded but does not have trace
'
do
context
'when build
is erased
'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
)
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:erased
)
}
it
'is a correct match'
do
it
'is a correct match'
do
build
.
erase
expect
(
subject
).
to
be
true
expect
(
subject
).
to
be
true
end
end
end
end
context
'when build
succeed but has trace
'
do
context
'when build
is not erased
'
do
let
!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_artifact
)
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_artifact
)
}
it
'does not match'
do
it
'does not match'
do
expect
(
subject
).
to
be
false
expect
(
subject
).
to
be
false
...
...
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
f379e1b3
...
@@ -36,21 +36,32 @@ describe Gitlab::Ci::Status::Build::Factory do
...
@@ -36,21 +36,32 @@ describe Gitlab::Ci::Status::Build::Factory do
expect
(
status
).
to
have_details
expect
(
status
).
to
have_details
expect
(
status
).
to
have_action
expect
(
status
).
to
have_action
end
end
end
context
'when job log gets erased'
do
context
'when build is erased'
do
before
do
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:erased
)
}
build
.
erase
end
it
'matches correct extended statuses'
do
it
'matches correct core status'
do
expect
(
factory
.
extended_statuses
)
expect
(
factory
.
core_status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Success
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Success
,
end
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
]
end
it
'fabricates a retryable build status'
do
it
'matches correct extended statuses'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
expect
(
factory
.
extended_statuses
)
end
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Erased
,
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
]
end
it
'fabricates a retryable build status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
end
it
'fabricates status with correct details'
do
expect
(
status
.
text
).
to
eq
'passed'
expect
(
status
.
icon
).
to
eq
'status_success'
expect
(
status
.
favicon
).
to
eq
'favicon_status_success'
expect
(
status
.
label
).
to
eq
'passed'
expect
(
status
).
to
have_details
expect
(
status
).
to
have_action
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