CI: drop -coverprofile from unit-tests to enable Go test result cache#37389
Closed
silverwind wants to merge 1 commit intogo-gitea:mainfrom
Closed
CI: drop -coverprofile from unit-tests to enable Go test result cache#37389silverwind wants to merge 1 commit intogo-gitea:mainfrom
silverwind wants to merge 1 commit intogo-gitea:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
test-unitjob invokesmake unit-test-coverage, which passes-coverprofiletogo 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.outis unused. I verified:make coverage(Makefile:405–409), which merges it intocoverage.all.make coverageis never called by any workflow, shell script, or CI config in the repo.coverage.allis never uploaded or consumed anywhere.test-mysqlat 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 totest-unit.Switch to
make test-backend, preserving the 20m timeout viaGOTESTFLAGS. 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
mainthe 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