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
ddb3b834
Commit
ddb3b834
authored
Jan 25, 2022
by
Ilya Vassilevsky
Committed by
Marcel Amirault
Jan 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve description of GitLab CI YAML `coverage` regex usage
parent
2f8de49d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
doc/ci/yaml/index.md
doc/ci/yaml/index.md
+14
-8
No files found.
doc/ci/yaml/index.md
View file @
ddb3b834
...
...
@@ -1321,12 +1321,14 @@ Use `coverage` with a custom regular expression to configure how code coverage
is extracted from the job output. The coverage is shown in the UI if at least one
line in the job output matches the regular expression.
To extract the code coverage value
in the matching line, GitLab uses thi
s
regular expression:
`\d+(\.\d+)?`
.
To extract the code coverage value
from the match, GitLab use
s
this smaller
regular expression:
`\d+(\.\d+)?`
.
**Possible inputs**
:
-
A regular expression. Must start and end with
`/`
.
-
A regular expression. Must start and end with
`/`
. Must match the coverage number.
May match surrounding text as well, so you don't need to use a regular expression character group
to capture the exact number.
**Example of `coverage`**
:
...
...
@@ -1338,14 +1340,18 @@ job1:
In this example:
1.
GitLab checks the job log for a
line that matches
the regular expression. A line
like
`Code coverage: 67.89`
would match.
1.
GitLab then checks the
line to find a match to
`\d+(\.\d+)?`
. The sample matching
line above gives a code coverage of
`67.89`
.
1.
GitLab checks the job log for a
match with
the regular expression. A line
like
`Code coverage: 67.89
% of lines covered
`
would match.
1.
GitLab then checks the
matched fragment to find a match to
`\d+(\.\d+)?`
.
The sample matching
line above gives a code coverage of
`67.89`
.
**Additional details**
:
-
If there is more than one matched line in the job output, the last line is used.
-
If there is more than one matched line in the job output, the last line is used
(the first result of reverse search).
-
If there are multiple matches in a single line, the last match is searched
for the coverage number.
-
If there are multiple coverage numbers found in the matched fragment, the first number is used.
-
Leading zeros are removed.
-
Coverage output from
[
child pipelines
](
../pipelines/parent_child_pipelines.md
)
is not recorded or displayed. Check
[
the related issue
](
https://gitlab.com/gitlab-org/gitlab/-/issues/280818
)
...
...
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