Add coverage test badge
Currently the test coverage verification is already being done, however it is necessary to add the badge in the repository settings, just follow the steps below:
- Go to general settings
- In the general settings, search for badges and fill in the following fields:
Name: Test Coverage
Link: https://gitlab.com/%{project_path}/-/commits/%{default_branch}
Badge image URL: https://gitlab.com/%{project_path}/badges/%{default_branch}/coverage.svg
- Now that the badge is added, we need to specify the path to test coverage result. In Settings -> CI/CD:
- Search for General Pipelines, scroll to the test coverage parser and add the following regex:
Test coverage parsing: ^TOTAL.+?(\d+%)$
Good job! The next successful pipeline will show the project's test coverage. An example can be seen in this fork.