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
13cee6d7
Commit
13cee6d7
authored
Dec 05, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test failures
parent
10499677
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
app/models/ci/stage.rb
app/models/ci/stage.rb
+3
-3
lib/gitlab/ci/status/stage/common.rb
lib/gitlab/ci/status/stage/common.rb
+2
-2
spec/lib/gitlab/ci/status/stage/common_spec.rb
spec/lib/gitlab/ci/status/stage/common_spec.rb
+2
-2
spec/lib/gitlab/ci/status/stage/factory_spec.rb
spec/lib/gitlab/ci/status/stage/factory_spec.rb
+4
-2
No files found.
app/models/ci/stage.rb
View file @
13cee6d7
...
...
@@ -8,7 +8,7 @@ module Ci
delegate
:project
,
to: :pipeline
def
initialize
(
pipeline
,
name:
name
,
status:
nil
)
def
initialize
(
pipeline
,
name
:,
status:
nil
)
@pipeline
,
@name
,
@status
=
pipeline
,
name
,
status
end
...
...
@@ -25,11 +25,11 @@ module Ci
end
def
statuses
@statuses
||=
pipeline
.
statuses
.
where
(
stage:
stag
e
)
@statuses
||=
pipeline
.
statuses
.
where
(
stage:
nam
e
)
end
def
builds
@builds
||=
pipeline
.
builds
.
where
(
stage:
stag
e
)
@builds
||=
pipeline
.
builds
.
where
(
stage:
nam
e
)
end
end
end
lib/gitlab/ci/status/stage/common.rb
View file @
13cee6d7
...
...
@@ -10,8 +10,8 @@ module Gitlab
def
details_path
namespace_project_pipeline_path
(
@subject
.
project
.
namespace
,
@subject
.
project
,
@subject
,
anchor:
subject
.
name
)
@subject
.
pipeline
,
anchor:
@
subject
.
name
)
end
def
has_action?
...
...
spec/lib/gitlab/ci/status/stage/common_spec.rb
View file @
13cee6d7
...
...
@@ -2,11 +2,11 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Stage
::
Common
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:stage
)
{
Ci
::
Stage
.
new
(
pipeline
,
'test'
)
}
let
(
:stage
)
{
Ci
::
Stage
.
new
(
pipeline
,
name:
'test'
)
}
subject
do
Class
.
new
(
Gitlab
::
Ci
::
Status
::
Core
)
.
new
(
pipelin
e
).
extend
(
described_class
)
.
new
(
stag
e
).
extend
(
described_class
)
end
it
'does not have action'
do
...
...
spec/lib/gitlab/ci/status/stage/factory_spec.rb
View file @
13cee6d7
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Stage
::
Factory
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:stage
)
{
Ci
::
Stage
.
new
(
pipeline
,
'test'
)
}
let
(
:stage
)
{
Ci
::
Stage
.
new
(
pipeline
,
name:
'test'
)
}
subject
do
described_class
.
new
(
stage
)
...
...
@@ -15,7 +15,9 @@ describe Gitlab::Ci::Status::Stage::Factory do
context
'when stage has a core status'
do
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
core_status
|
context
"when core status is
#{
core_status
}
"
do
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
.
name
,
status:
core_status
)
}
let!
(
:build
)
do
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
,
status:
core_status
)
end
it
"fabricates a core status
#{
core_status
}
"
do
expect
(
status
).
to
be_a
(
...
...
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