chore: combine the integration test coverage with the unit test coverage

Description

Reports a single coverage metric that combines unit and integration test coverage.

Previously the reported coverage number was unit-only: only tests:unit declared a coverage: regex and the project has no build_coverage_regex, so integration-test coverage never contributed to the number (there was no averaging between the two). This moves the coverage: regex to a dedicated tests:coverage job that merges both profiles, so coverage contributed solely by integration tests stops penalizing the reported number.

The two text coverage profiles are merged by concatenation under a single mode: atomic header. Go's cover.ParseProfiles sums the counts for duplicate blocks, so concatenating the profiles is equivalent to a dedicated merge tool (for example, gocovmerge) while adding no external dependency. The coverage-merge target guards that both profiles share the mode: atomic header before merging. tests:unit keeps its JUnit report (coverage-unit.xml) so the merge request widget's failed-test list is preserved.

Resolves #8046 (closed)

How has this been tested?

Verified the concatenation merge against two overlapping text profiles: the merged profile keeps a single mode: atomic header, and go tool cover -func reads it correctly with duplicate blocks summed. Also verified the header-equality guard rejects mismatched covermodes (for example, mode: set or mode: count alongside mode: atomic).

Note

Fork vs. canonical pipelines report different numbers: GITLAB_TOKEN_TEST and GITLAB_TEST_HOST are canonical-project variables, so integration tests are skipped in the gitlab-community fork where community MR pipelines run. main reports the combined number; community MRs report an effectively unit-only number.

Screenshots (if appropriate):

Edited by Swapnaneel Patra

Merge request reports

Loading
Loading