I cannot find Gitlab's test coverage parsing setting in my CI/CD settings
Asked Answered
E

1

9

I would like to set the regular expression for my test coverage results.

According to Gitlab's documentation, I should be able to do that in the test coverage parsing setting in my project settings, by navigating to Settings > CI/CD > General pipelines.

However, I cannot find the setting there. Where can I set the regular expression for the test coverage parsing setting in Gitlab?

Estivate answered 23/6, 2022 at 19:41 Comment(0)
E
31

Since Gitlab 14.8, the test coverage parsing setting has been deprecated and has been removed since Gitlab 15.0. The setting can therefore no longer be found in Settings > CI/CD > General pipelines.

You should now use the coverage setting in your Gitlab CI/CD configuration file and use your regular expression in the setting value:

Example:

unit-test:
  stage: test
  coverage: '/coverage: \d+.\d+% of statements/'
  script:
    - go test -cover
Estivate answered 23/6, 2022 at 19:41 Comment(1)
Worth mentioning that this style of coverage reporting is not accurate if your application has several packages.Spectacular

© 2022 - 2024 — McMap. All rights reserved.