Repository navigation
ci(go): run unit tests on main and release branches - #177
Merged
BraveY merged 1 commit intoOct 23, 2026
Merged
Conversation
The existing workflows lint and analyze Go code but do not execute the repository's unit tests. Add a dedicated job for main and release-* pushes and pull requests targeting those branches, using the Go version declared in go.mod. Run the suite with the race detector so tests that exercise the concurrent benchmark code also check for data races. Use read-only module resolution and disable test-result caching so every job executes the assertions and fails on a failing test. Expose the command as make test and make test-race so local runs and CI share one definition. Signed-off-by: Lv Ying <lvying.system.thoughts@gmail.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.
Description
The existing workflows lint and analyze Go code but never execute the repository's tests. Add a
Testsworkflow and expose the command as Makefile targets so CI and local runs share one definition.The job pins the Go version from
go.mod, runs with read-only module resolution and no test-result caching, and uses the race detector.Related Issue
None. This is CI infrastructure; happy to open an issue first if the project prefers that.
Motivation and Context
pkg/**gained 13 test files (30 test functions, 58 cases including subtests) in #166, #167 and #169, but no workflow ran them, so a regression could land while every check stayed green.Evidence
.github/workflows; tests only ran manually.After:
make test-racepasses and the workflow runs it on every push/PR.All 30 test functions run; the other 7 packages report
[no test files].Merge Danger
Door: two-way — the workflow and Makefile targets are additive and can be reverted without touching production code.
Blast Radius: CI-only
Once the
Go unit testscheck is marked required in branch protection, a failing test blocks merges onmainandrelease-*. No runtime behavior changes.