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
e1732898
Commit
e1732898
authored
Nov 25, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zj-expose-coverage-pipelines' into 'master'
Expose coverage on GET pipelines/:id Closes gitlab-org/gitlab-ce#24801 See merge request !7670
parents
746b6ec8
752d72f8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
6 deletions
+29
-6
zj-expose-coverage-pipelines.yml
changelogs/unreleased/zj-expose-coverage-pipelines.yml
+4
-0
pipelines.md
doc/api/pipelines.md
+12
-6
entities.rb
lib/api/entities.rb
+1
-0
pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+12
-0
No files found.
changelogs/unreleased/zj-expose-coverage-pipelines.yml
0 → 100644
View file @
e1732898
---
title
:
'
API:
expose
pipeline
coverage'
merge_request
:
author
:
doc/api/pipelines.md
View file @
e1732898
...
...
@@ -41,7 +41,8 @@ Example of response
"started_at"
:
null
,
"finished_at"
:
null
,
"committed_at"
:
null
,
"duration"
:
null
"duration"
:
null
,
"coverage"
:
"30.0"
},
{
"id"
:
48
,
...
...
@@ -64,7 +65,8 @@ Example of response
"started_at"
:
null
,
"finished_at"
:
null
,
"committed_at"
:
null
,
"duration"
:
null
"duration"
:
null
,
"coverage"
:
null
}
]
```
...
...
@@ -110,7 +112,8 @@ Example of response
"started_at"
:
null
,
"finished_at"
:
"2016-08-11T11:32:35.145Z"
,
"committed_at"
:
null
,
"duration"
:
null
"duration"
:
null
,
"coverage"
:
"30.0"
}
```
...
...
@@ -155,7 +158,8 @@ Example of response
"started_at"
:
null
,
"finished_at"
:
null
,
"committed_at"
:
null
,
"duration"
:
null
"duration"
:
null
,
"coverage"
:
null
}
```
...
...
@@ -200,7 +204,8 @@ Response:
"started_at"
:
null
,
"finished_at"
:
"2016-08-11T11:32:35.145Z"
,
"committed_at"
:
null
,
"duration"
:
null
"duration"
:
null
,
"coverage"
:
null
}
```
...
...
@@ -245,7 +250,8 @@ Response:
"started_at"
:
null
,
"finished_at"
:
"2016-08-11T11:32:35.145Z"
,
"committed_at"
:
null
,
"duration"
:
null
"duration"
:
null
,
"coverage"
:
null
}
```
...
...
lib/api/entities.rb
View file @
e1732898
...
...
@@ -607,6 +607,7 @@ module API
expose
:user
,
with:
Entities
::
UserBasic
expose
:created_at
,
:updated_at
,
:started_at
,
:finished_at
,
:committed_at
expose
:duration
expose
:coverage
end
class
EnvironmentBasic
<
Grape
::
Entity
...
...
spec/requests/api/pipelines_spec.rb
View file @
e1732898
...
...
@@ -103,6 +103,18 @@ describe API::API, api: true do
expect
(
json_response
[
'message'
]).
to
eq
'404 Not found'
expect
(
json_response
[
'id'
]).
to
be
nil
end
context
'with coverage'
do
before
do
create
(
:ci_build
,
coverage:
30
,
pipeline:
pipeline
)
end
it
'exposes the coverage'
do
get
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
user
)
expect
(
json_response
[
"coverage"
].
to_i
).
to
eq
(
30
)
end
end
end
context
'unauthorized user'
do
...
...
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