Skip to content

CI: drop -coverprofile from unit-tests to enable Go test result cache#37389

Closed
silverwind wants to merge 1 commit intogo-gitea:mainfrom
silverwind:ci-drop-unit-test-coverage
Closed

CI: drop -coverprofile from unit-tests to enable Go test result cache#37389
silverwind wants to merge 1 commit intogo-gitea:mainfrom
silverwind:ci-drop-unit-test-coverage

Conversation

@silverwind
Copy link
Copy Markdown
Member

The test-unit job invokes make unit-test-coverage, which passes -coverprofile to go test. That flag is not in Go's cacheable-flags allowlist (docs), so it silently disables the test result cache for every unit-test package on every run.

coverage.out is unused. I verified:

  • The only consumer is make coverage (Makefile:405–409), which merges it into coverage.all.
  • make coverage is never called by any workflow, shell script, or CI config in the repo.
  • coverage.all is never uploaded or consumed anywhere.
  • No codecov/coveralls integration exists (only two archived CHANGELOG mentions from years ago).
  • The comment already present in test-mysql at line 202 — # run: make integration-test-coverage (at the moment, no coverage is really handled) — confirms coverage has been knowingly dead for some time; this PR applies the same cleanup to test-unit.

Switch to make test-backend, preserving the 20m timeout via GOTESTFLAGS. On warm runs with an intact build cache, unchanged unit-test packages are now skipped entirely rather than re-executed.

Dependency

The practical benefit requires the build cache to persist across runs. On current main the cache is ineffective (see #37387, which fixes the cache key collision). Landing this PR on its own gives no real speedup; landing it after #37387 unlocks genuine test-result caching for unit tests.


This PR was written with the help of Claude Opus 4.7

The test-unit job invoked 'make unit-test-coverage', which passes
-coverprofile to 'go test'. That flag is not in Go's cacheable-flags
allowlist, so it silently disables the test result cache for every
unit-test package on every run.

The coverage.out output is unused: no workflow calls 'make coverage'
(its only consumer), and no codecov/coveralls integration exists.
The matching test-mysql job comment ('at the moment, no coverage is
really handled') confirms coverage has been dead for some time.

Switch to 'make test-backend', preserving the 20m timeout via
GOTESTFLAGS. On warm runs with an intact build cache, unchanged
unit-test packages are now skipped entirely.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 23, 2026
@silverwind silverwind closed this Apr 23, 2026
@silverwind silverwind deleted the ci-drop-unit-test-coverage branch April 23, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants