Skip to content

Use undercover to enforce changes in MR has coverage

Thong Kuah requested to merge undercover into master

What does this MR do and why?

Related issue: #345962 (closed)

Use the undercover gem to enforce changes in MR has coverage. This will fail the pipeline if changes introduced in this MR has zero coverage

How this works :

  1. We generate coverage data as usual
  2. We gather coverage data from all RSpec jobs as usual
  3. We use undercover gem to calculate the MR diff, and fail the job if any lines in the diff has zero coverage (see https://gitlab.com/gitlab-org/gitlab/-/jobs/1804857414 for example)

Tasks:

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

Failing rspec:coverage job

Screen_Shot_2021-11-22_at_10.52.49_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports