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
0ec3a031
Commit
0ec3a031
authored
Mar 31, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the test coverage if it is available
Do not check if coverage is enabled, just show it when it is available.
parent
49bdd8d6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
16 deletions
+12
-16
merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
project.rb
app/models/project.rb
+0
-4
_table.html.haml
app/views/projects/builds/_table.html.haml
+1
-1
_build.html.haml
app/views/projects/ci/builds/_build.html.haml
+1
-2
_pipeline.html.haml
app/views/projects/commit/_pipeline.html.haml
+1
-2
_generic_commit_status.html.haml
.../generic_commit_statuses/_generic_commit_status.html.haml
+1
-2
_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+1
-2
_stage.html.haml
app/views/projects/stage/_stage.html.haml
+2
-2
tc-show-pipeline-coverage-if-avail.yml
changelogs/unreleased/tc-show-pipeline-coverage-if-avail.yml
+4
-0
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
0ec3a031
...
...
@@ -452,7 +452,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if
pipeline
status
=
pipeline
.
status
coverage
=
pipeline
.
try
(
:coverage
)
coverage
=
pipeline
.
coverage
status
=
"success_with_warnings"
if
pipeline
.
success?
&&
pipeline
.
has_warnings?
...
...
app/models/project.rb
View file @
0ec3a031
...
...
@@ -1110,10 +1110,6 @@ class Project < ActiveRecord::Base
self
.
runners_token
&&
ActiveSupport
::
SecurityUtils
.
variable_size_secure_compare
(
token
,
self
.
runners_token
)
end
def
build_coverage_enabled?
build_coverage_regex
.
present?
end
def
build_timeout_in_minutes
build_timeout
/
60
end
...
...
app/views/projects/builds/_table.html.haml
View file @
0ec3a031
...
...
@@ -20,6 +20,6 @@
%th
Coverage
%th
=
render
partial:
"projects/ci/builds/build"
,
collection:
builds
,
as: :build
,
locals:
{
commit_sha:
true
,
ref:
true
,
pipeline_link:
true
,
stage:
true
,
allow_retry:
true
,
coverage:
admin
||
project
.
build_coverage_enabled?
,
admin:
admin
}
=
render
partial:
"projects/ci/builds/build"
,
collection:
builds
,
as: :build
,
locals:
{
commit_sha:
true
,
ref:
true
,
pipeline_link:
true
,
stage:
true
,
allow_retry:
true
,
admin:
admin
}
=
paginate
builds
,
theme:
'gitlab'
app/views/projects/ci/builds/_build.html.haml
View file @
0ec3a031
...
...
@@ -4,7 +4,6 @@
-
retried
=
local_assigns
.
fetch
(
:retried
,
false
)
-
pipeline_link
=
local_assigns
.
fetch
(
:pipeline_link
,
false
)
-
stage
=
local_assigns
.
fetch
(
:stage
,
false
)
-
coverage
=
local_assigns
.
fetch
(
:coverage
,
false
)
-
allow_retry
=
local_assigns
.
fetch
(
:allow_retry
,
false
)
%tr
.build.commit
{
class:
(
'retried'
if
retried
)
}
...
...
@@ -88,7 +87,7 @@
%span
=
time_ago_with_tooltip
(
build
.
finished_at
)
%td
.coverage
-
if
coverage
&&
build
.
try
(
:coverage
)
-
if
build
.
try
(
:coverage
)
#{
build
.
coverage
}
%
%td
...
...
app/views/projects/commit/_pipeline.html.haml
View file @
0ec3a031
...
...
@@ -47,7 +47,6 @@
%th
Job ID
%th
Name
%th
-
if
pipeline
.
project
.
build_coverage_enabled?
%th
Coverage
%th
Coverage
%th
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
stages
,
as: :stage
app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
View file @
0ec3a031
...
...
@@ -4,7 +4,6 @@
-
retried
=
local_assigns
.
fetch
(
:retried
,
false
)
-
pipeline_link
=
local_assigns
.
fetch
(
:pipeline_link
,
false
)
-
stage
=
local_assigns
.
fetch
(
:stage
,
false
)
-
coverage
=
local_assigns
.
fetch
(
:coverage
,
false
)
%tr
.generic_commit_status
{
class:
(
'retried'
if
retried
)
}
%td
.status
...
...
@@ -80,7 +79,7 @@
%span
=
time_ago_with_tooltip
(
generic_commit_status
.
finished_at
)
%td
.coverage
-
if
coverage
&&
generic_commit_status
.
try
(
:coverage
)
-
if
generic_commit_status
.
try
(
:coverage
)
#{
generic_commit_status
.
coverage
}
%
%td
...
...
app/views/projects/pipelines/_with_tabs.html.haml
View file @
0ec3a031
...
...
@@ -36,7 +36,6 @@
%th
Job ID
%th
Name
%th
-
if
pipeline
.
project
.
build_coverage_enabled?
%th
Coverage
%th
Coverage
%th
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
stages
,
as: :stage
app/views/projects/stage/_stage.html.haml
View file @
0ec3a031
...
...
@@ -6,8 +6,8 @@
=
ci_icon_for_status
(
stage
.
status
)
=
stage
.
name
.
titleize
=
render
stage
.
statuses
.
latest_ordered
,
coverage:
@project
.
build_coverage_enabled?
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
allow_retry:
true
=
render
stage
.
statuses
.
retried_ordered
,
coverage:
@project
.
build_coverage_enabled?
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
retried:
true
=
render
stage
.
statuses
.
latest_ordered
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
allow_retry:
true
=
render
stage
.
statuses
.
retried_ordered
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
retried:
true
%tr
%td
{
colspan:
10
}
changelogs/unreleased/tc-show-pipeline-coverage-if-avail.yml
0 → 100644
View file @
0ec3a031
---
title
:
Show the build/pipeline coverage if it is available
merge_request
:
author
:
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