CI: Track spec coverage via simplecov
What does this MR do and why?
This MR adds spec coverage via SimpleCov. It runs in CI (also using cobertura reports - only for Ruby 3.0 to save CPU cycles) and locally (HTML format). It can be disabled via SIMPLECOV=0 bundle exec rspec
.
This was inspired while moving cops in !151 (merged). Some cops did not have specs and were missing code coverage.
https://gitlab-org.gitlab.io/-/ruby/gems/gitlab-styles/-/jobs/3587879161/artifacts/coverage/index.html | https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/jobs/3587879161#L757 |
---|---|
![]() |
![]() |
Potential follow-ups
- Approve MRs based on code coverage. See https://docs.gitlab.com/ee/user/project/merge_requests/approvals/settings.html#code-coverage-check-approvals
Edited by Peter Leitzen