ci: add go test, go vet, and staticcheck gates to build-verify workflow#356
Open
Harishrs2006 wants to merge 1 commit into
Open
ci: add go test, go vet, and staticcheck gates to build-verify workflow#356Harishrs2006 wants to merge 1 commit into
Harishrs2006 wants to merge 1 commit into
Conversation
The CI pipeline only compiled binaries — tests, go vet, and static analysis never ran on any PR. This allowed real bugs to ship undetected: - req.Body/resp.Body mismatch (PR microcks#338) caught by go vet - panic(err.Error()) in connectors (PR microcks#341, microcks#319) caught by staticcheck - TestDeleteContext failing on clean checkout (PR microcks#334) caught by go test - fmt.Errorf result discarded in watcher/executor.go caught by go vet (fixed here) Add three mandatory steps before the build: go test ./..., go vet ./..., and staticcheck via dominikh/staticcheck-action. Also add make test and make vet targets for local developer use. Also fix the go vet finding in pkg/watcher/executor.go where fmt.Errorf was called but its return value was discarded, silently swallowing errors. Fixes microcks#355 Signed-off-by: Harish R S <harishrs21082006@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.
Summary:
The CI pipeline only compiled binaries —
go test,go vet, and static analysis never ran on any PR. Real bugs shipped undetected as a result.Evidence: what these gates catch
req.Bodyread instead ofresp.Bodygo vetpanic(err.Error())in connector codestaticcheckTestDeleteContextfails on clean checkoutgo test ./...staticcheckfmt.Errorfresult discarded inwatcher/executor.gogo vet← caught immediatelyChanges:
.github/workflows/build-verify.yml— addgo test ./...,go vet ./..., andstaticchecksteps before the build stepMakefile— addmake testandmake vettargets for local developer usepkg/watcher/executor.go— fixgo vetfinding:fmt.Errorfreturn value was discarded, silently swallowing config load errors (replaced withfmt.Printf+return)Testing
go test ./... ✅ all pass
go vet ./... ✅ clean (after executor.go fix)
go build ./... ✅ clean
Fixes #355