Skip to content

ci(coverage): report correct coverage

Jay McCure requested to merge jmc-fix-coverage into main

Description

Previously we were reporting the coverage of the last test file executed. For example, see: https://gitlab.com/gitlab-org/cli/-/jobs/3690496036#L178 is 61.5% when it is actually 61.2%

This adds a cover make target which runs go tool cover -func coverage.txt which will output the overall coverage. It runs in the after_script of the run_tests job. I've put the output in a collapsible section as the coverage output is quite verbose.

Related Issues

Resolves #1177 (closed)

How has this been tested?

https://gitlab.com/gitlab-org/cli/-/jobs/3693461278

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
Edited by Jay McCure

Merge request reports