Skip to content

tests: raise check-layers coverage from 49% to 88%#1

Merged
TeoSlayer merged 1 commit into
mainfrom
add-test-coverage
May 27, 2026
Merged

tests: raise check-layers coverage from 49% to 88%#1
TeoSlayer merged 1 commit into
mainfrom
add-test-coverage

Conversation

@TeoSlayer
Copy link
Copy Markdown
Contributor

Summary

  • Adds zz_integration_test.go driving main() end-to-end against small in-tmp Go modules: happy path, --tests mode, default ./... fallback, transitional-warning branch, and side-channel bypass branch.
  • Exercises goList directly (happy path, with-tests dedup of synthetic *.test packages, error path on a missing import).
  • Covers the loadLayersYAML cwd walk-up fallback (previously the only uncovered branch in that fn).
  • Also tracks the previously-untracked zz_helpers_test.go so the suite is reproducible.

Coverage

  • Before: 49.1% (with local zz_helpers_test.go) / 30.6% on main HEAD.
  • After: 88.4% (go test -race -coverprofile=coverage.out -covermode=atomic ./...).
  • Per-function: main 0%->75.3%, goList 0%->87.5%, loadLayersYAML 80%->100%.
  • Remaining gap is intentional: every uncovered line is downstream of os.Exit (fatalf, the os.Exit(1) violation branch, goList's decode-error branch).

Test plan

  • go test -race -count=1 -timeout 120s ./... passes (1.66s).
  • go test -race -coverprofile=coverage.out -covermode=atomic ./... (CI command) passes at 88.4%.
  • No production code modified; only *_test.go additions.
  • cwd-mutating tests (runMainIn, goList callers) are sequential to avoid races against parallel suites.

Add zz_integration_test.go: drives main() end-to-end against tiny
in-tmp Go modules, plus direct goList coverage (happy path, --tests,
error path) and the loadLayersYAML walk-up fallback. Track the
previously-untracked zz_helpers_test.go alongside.

Per-function: main 0->75%, goList 0->88%, loadLayersYAML 80->100%.
Only os.Exit branches (fatalf, hard violation, go list crash) remain
uncovered.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@TeoSlayer TeoSlayer merged commit 74130f6 into main May 27, 2026
3 checks passed
@TeoSlayer TeoSlayer deleted the add-test-coverage branch May 27, 2026 23:24
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