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
b2a79554
Unverified
Commit
b2a79554
authored
Jul 14, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address feedback.
parent
b306a521
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
pipeline.rb
app/models/ci/pipeline.rb
+2
-4
pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+18
-6
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
b2a79554
...
...
@@ -286,7 +286,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
status
=
pipeline
.
status
coverage
=
pipeline
.
try
(
:coverage
)
status
=
"success_with_warnings"
if
pipeline
.
success?
&&
pipeline
.
with
_warnings?
status
=
"success_with_warnings"
if
pipeline
.
success?
&&
pipeline
.
has
_warnings?
status
||=
"preparing"
else
...
...
app/models/ci/pipeline.rb
View file @
b2a79554
...
...
@@ -146,10 +146,8 @@ module Ci
end
end
def
with_warnings?
builds
.
latest
.
any?
do
|
build
|
build
.
failed?
&&
build
.
allow_failure
end
def
has_warnings?
builds
.
latest
.
ignored
.
any?
end
def
config_processor
...
...
spec/models/ci/pipeline_spec.rb
View file @
b2a79554
...
...
@@ -503,13 +503,13 @@ describe Ci::Pipeline, models: true do
end
end
describe
'#
with
_warnings?'
do
subject
{
pipeline
.
with
_warnings?
}
describe
'#
has
_warnings?'
do
subject
{
pipeline
.
has
_warnings?
}
context
'build which is allowed to fail fails'
do
before
do
FactoryGirl
.
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
FactoryGirl
.
create
:ci_build
,
:allowed_to_fail
,
:failed
,
pipeline:
pipeline
,
name:
'rubocop'
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:allowed_to_fail
,
:failed
,
pipeline:
pipeline
,
name:
'rubocop'
end
it
'returns true'
do
...
...
@@ -519,13 +519,25 @@ describe Ci::Pipeline, models: true do
context
'build which is allowed to fail succeeds'
do
before
do
FactoryGirl
.
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
FactoryGirl
.
create
:ci_build
,
:allowed_to_fail
,
:success
,
pipeline:
pipeline
,
name:
'rubocop'
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:allowed_to_fail
,
:success
,
pipeline:
pipeline
,
name:
'rubocop'
end
it
'returns false'
do
is_expected
.
to
be_falsey
end
end
context
'build is retried and succeeds'
do
before
do
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rubocop'
create
:ci_build
,
:failed
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
end
it
'returns false'
do
is_expected
.
to
be_falsey
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