Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ci/pipelines/settings.md')
-rw-r--r--doc/ci/pipelines/settings.md56
1 files changed, 30 insertions, 26 deletions
diff --git a/doc/ci/pipelines/settings.md b/doc/ci/pipelines/settings.md
index 4ae4aabbf5a..373244acbb9 100644
--- a/doc/ci/pipelines/settings.md
+++ b/doc/ci/pipelines/settings.md
@@ -195,13 +195,7 @@ Jobs that exceed the timeout are marked as failed.
You can override this value [for individual runners](../runners/configure_runners.md#set-maximum-job-timeout-for-a-runner).
-## Add test coverage results to a merge request (DEPRECATED)
-
-> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/17633) in GitLab 14.9. Replaced by [`coverage` keyword](../yaml/index.md#coverage).
-
-WARNING:
-This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/17633)
-for use in GitLab 14.9, and is planned for [removal](https://gitlab.com/gitlab-org/gitlab/-/issues/17633) in GitLab 15.0.
+## Merge request test coverage results
If you use test coverage in your code, you can use a regular expression to
find coverage results in the job log. You can then include these results
@@ -215,27 +209,38 @@ averaged.
![Build status coverage](img/pipelines_test_coverage_build.png)
-To define a coverage-parsing regular expression:
+### Add test coverage results using `coverage` keyword
+
+To add test coverage results to a merge request using the project's `.gitlab-ci.yml` file, provide a regular expression
+using the [`coverage`](../yaml/index.md#coverage) keyword.
+
+Setting the regular expression this way takes precedence over project settings.
-- Using the project's `.gitlab-ci.yml`, provide a regular expression using the [`coverage`](../yaml/index.md#coverage)
- keyword. Setting the regular expression this way takes precedence over the project's CI/CD settings.
+### Add test coverage results using project settings (DEPRECATED)
-- Using the Project's CI/CD settings:
- - Set using the GitLab UI:
+> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/17633) in GitLab 14.9. Replaced by [`coverage` keyword](../yaml/index.md#coverage).
+
+WARNING:
+This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/17633)
+for use in GitLab 14.9, and is planned for [removal](https://gitlab.com/gitlab-org/gitlab/-/issues/17633) in GitLab 15.0.
+
+You can add test coverage results to merge requests using the Project's CI/CD settings:
- 1. On the top bar, select **Menu > Projects** and find your project.
- 1. On the left sidebar, select **Settings > CI/CD**.
- 1. Expand **General pipelines**.
- 1. In the **Test coverage parsing** field, enter a regular expression. Leave blank to disable this feature.
+- Set using the GitLab UI:
- - Set when [editing a project](../../api/projects.md#edit-project) or [creating a project](../../api/projects.md#create-project)
- using the GitLab API with the `build_coverage_regex` attribute:
+ 1. On the top bar, select **Menu > Projects** and find your project.
+ 1. On the left sidebar, select **Settings > CI/CD**.
+ 1. Expand **General pipelines**.
+ 1. In the **Test coverage parsing** field, enter a regular expression. Leave blank to disable this feature.
- ```shell
- curl --request PUT --header "PRIVATE-TOKEN: <your-token>" \
- --url 'https://gitlab.com/api/v4/projects/<your-project-ID>' \
- --data "build_coverage_regex=<your-regular-expression>"
- ```
+- Set when [editing a project](../../api/projects.md#edit-project) or [creating a project](../../api/projects.md#create-project)
+ using the GitLab API with the `build_coverage_regex` attribute:
+
+ ```shell
+ curl --request PUT --header "PRIVATE-TOKEN: <your-token>" \
+ --url 'https://gitlab.com/api/v4/projects/<your-project-ID>' \
+ --data "build_coverage_regex=<your-regular-expression>"
+ ```
You can use <https://rubular.com> to test your regular expression. The regular expression returns the **last**
match found in the output.
@@ -372,9 +377,8 @@ https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg?ig
### Test coverage report badge
-You can define the regular expression for the [coverage report](#add-test-coverage-results-to-a-merge-request-deprecated)
-that each job log is matched against. This means that each job in the
-pipeline can have the test coverage percentage value defined.
+You can define the regular expression for the [coverage report](#merge-request-test-coverage-results) that each job log
+is matched against. This means that each job in the pipeline can have the test coverage percentage value defined.
To access the test coverage badge, use the following link: