Skip to content

ci(test): verbose output and 60% coverage threshold#9

Merged
oxGrad merged 1 commit intomainfrom
claude/verbose-test-coverage
Apr 1, 2026
Merged

ci(test): verbose output and 60% coverage threshold#9
oxGrad merged 1 commit intomainfrom
claude/verbose-test-coverage

Conversation

@oxGrad
Copy link
Copy Markdown
Owner

@oxGrad oxGrad commented Mar 31, 2026

Summary

Improves the Test CI job with verbose output and an enforced coverage threshold.

Changes

Run tests step — adds -v and -coverprofile=coverage.out:

  • -v prints 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.out collects statement coverage across all packages

Show coverage report step — runs go tool cover -func=coverage.out:

  • Prints a per-function breakdown showing exact coverage for every function across all packages

Enforce 60% coverage threshold step — parses the total: line and fails the job if below 60%:

Total coverage: 67.5%
OK: coverage 67.5% meets the 60% threshold

Uses awk for the float comparison (no extra dependencies).

Current coverage

Package Coverage
internal/config 96.0%
internal/resolver 100.0%
internal/linker 75.0%
total 67.5%

main and cmd have no test files (cobra wiring); all logic lives in internal/ which is well covered.

Test plan

  • go test -v -coverprofile=coverage.out ./... runs locally and total is 67.5%
  • Threshold script passes: 67.5 < 60 is false → exit 0
  • Verify job log shows individual test names on the PR check run

- 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
@oxGrad oxGrad merged commit 86ca309 into main Apr 1, 2026
3 checks passed
@oxGrad oxGrad deleted the claude/verbose-test-coverage branch April 1, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants