ci: restore full test coverage and remove duplicate e2e stub#121
Merged
Conversation
CI was only running ./internal/..., ./gen/..., and ./test/e2e/ - skipping ./cmd/... (all unit tests) and the canonical root e2e_test.go (100 tests). Expanded the test invocation to cover those packages, bringing ~1066 tests back under CI. Also removed test/e2e/e2e_test.go (8 tests, all duplicates of root e2e_test.go coverage) and the now-empty test/e2e/ directory.
Five tests passed on macOS but failed on Linux CI once they started running. Root causes: - Three template-related cmd tests (TestRunTemplateShow/List/Apply _LookupError) and TestBatchTemplateApply_LookupError rely on os.UserConfigDir() resolving into t.TempDir(). On Linux it reads XDG_CONFIG_HOME first, which on CI points outside the sandbox, so the sentinel file meant to trigger a ReadDir error was never consulted. Pin XDG_CONFIG_HOME to a path inside tmpHome. - TestBatchTemplateApply_LookupError only wrote the macOS sentinel path. Also write the Linux path (.config/jr/templates). - internal/template TestList read the real user templates dir with no sandboxing, picking up leftover state on CI runners. Override userTemplatesDir to a clean t.TempDir() for the duration of the test.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
1 task
sofq
added a commit
that referenced
this pull request
Apr 18, 2026
## Summary - Codecov dropped from 100% to 8.71% on #121 because expanding CI to `./cmd/...` pulled in `cmd/generated/` (51k LOC of OpenAPI-generated commands) at 0% coverage. - Adds `codecov.yml` to exclude `cmd/generated/**` and `cmd/gendocs/**` so the ratio reflects hand-written code only. ## Test plan - [ ] Codecov report on this PR shows restored coverage (~100% on tested packages)
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
./internal/...,./gen/..., and./test/e2e/- skipping./cmd/...(all unit tests) and the canonical roote2e_test.go(100 tests). Expanded to cover those, bringing ~1066 tests back under CI.test/e2e/e2e_test.go(8 tests, all duplicates of roote2e_test.go) and the now-emptytest/e2e/dir.Test plan
go build ./...cleango test ./cmd/... ./internal/... ./gen/... .- 1066 tests pass across 19 packages