ci(test): verbose output and 60% coverage threshold#9
Merged
Conversation
- go test -v so each test name and PASS/FAIL is visible in the job log - -coverprofile=coverage.out collects coverage across all packages - "Show coverage report" step prints per-function breakdown via go tool cover -func - "Enforce 60% coverage threshold" step parses the total line, prints the value, and exits 1 if below 60% (current coverage: 67.5%) https://claude.ai/code/session_018s5iF8MKZAobUjAuR1AHJ4
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
Improves the
TestCI job with verbose output and an enforced coverage threshold.Changes
Run testsstep — adds-vand-coverprofile=coverage.out:-vprints each test name (=== RUN,--- PASS,--- FAIL) as it runs, making failures immediately visible in the job log without having to dig through collapsed output-coverprofile=coverage.outcollects statement coverage across all packagesShow coverage reportstep — runsgo tool cover -func=coverage.out:Enforce 60% coverage thresholdstep — parses thetotal:line and fails the job if below 60%:Uses
awkfor the float comparison (no extra dependencies).Current coverage
internal/configinternal/resolverinternal/linkermainandcmdhave no test files (cobra wiring); all logic lives ininternal/which is well covered.Test plan
go test -v -coverprofile=coverage.out ./...runs locally and total is 67.5%67.5 < 60is false → exit 0