Commit 2aee6e96 authored by Marcel Amirault's avatar Marcel Amirault Committed by Evan Read

Update code coverage keyword reference style

parent 7c942a98
...@@ -3258,15 +3258,16 @@ job: ...@@ -3258,15 +3258,16 @@ job:
### `coverage` ### `coverage`
Use `coverage` to configure how code coverage is extracted from the Use `coverage` with a custom regular expression to configure how code coverage
job output. 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.
Regular expressions are the only valid kind of value expected here. So, using To extract the code coverage value in the matching line, GitLab uses this
surrounding `/` is mandatory to consistently and explicitly represent regular expression: `\d+(\.\d+)?`.
a regular expression string. You must escape special characters if you want to
match them literally.
For example: **Possible inputs**: A regular expression. Must start and end with `/`.
**Example of `coverage`**:
```yaml ```yaml
job1: job1:
...@@ -3274,14 +3275,20 @@ job1: ...@@ -3274,14 +3275,20 @@ job1:
coverage: '/Code coverage: \d+\.\d+/' coverage: '/Code coverage: \d+\.\d+/'
``` ```
The coverage is shown in the UI if at least one line in the job output matches the regular expression. In this example:
If there is more than one matched line in the job output, the last line is used.
For the matched line, the first occurrence of `\d+(\.\d+)?` is the code coverage. 1. GitLab checks the job log for a line that matches the regular expression. A line
Leading zeros are removed. 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`.
**Additional details**:
Coverage output from [child pipelines](../pipelines/parent_child_pipelines.md) is not recorded - If there is more than one matched line in the job output, the last line is used.
or displayed. Check [the related issue](https://gitlab.com/gitlab-org/gitlab/-/issues/280818) - Leading zeros are removed.
for more details. - 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)
for more details.
### `dast_configuration` **(ULTIMATE)** ### `dast_configuration` **(ULTIMATE)**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment