test: cover tree selector, Python/Ruby/Global integration, and DirSize - #11
Merged
Conversation
- ui: exercise the tree selector's toggle, parent/child selection propagation, cursor movement, quick-select keys, and Update key routing via injected KeyMsgs (internal/ui 35% -> 57%). - integration: add Python and Ruby project fixtures to the scan workspace and a Global-scanner pipeline test that injects HOME; regenerate the golden output for the new fixtures. - scanner: pin DirSize's sizing arithmetic (lower bound + growth), which the golden test can't verify since it zeroes Size out for portability. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc
Review follow-ups on the P2-7 test additions: - Zero ProjectRoot alongside the other volatile fields before writing the golden file — it held the committer's absolute temp path, leaking machine-specific data into version control. - Build the Global scanner directly with an isolated TmpRoot and a stubbed process check instead of going through the registry, so the HOME-injected test no longer scans real machine temp state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc
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.
What
P2-7 test coverage. Closes the untested areas from code-health finding #12 and the coverage survey.
Changes
internal/ui— the interactive tree selector's toggle (toggleCurrent), parent/child selection propagation (updateProjectState/isPartiallySelected), cursor movement (moveCursor/jumpProject), remaining quick-select keys (selectNone/selectByActivity), andUpdatekey routing (via injectedtea.KeyMsg) are now tested. Coverage 35% → 57%.internal/integration_test.go— the scan workspace gained Python (__pycache__,.pytest_cache) and Ruby (vendor/bundle,.bundle) project fixtures flowing through the real registry pipeline; a new test drives the Global (fixed-home) scanner through the registry with an injectedHOME. Golden output regenerated for the new fixtures.internal/scanner/sizing_test.go—DirSizenow has a test pinning the sizing arithmetic (reported size covers the logical content as a lower bound and grows with more data), the one thing the golden test can't check since it zeroesSizeout for portability.Verification
go test ./...— all pass;go test -race ./internal/ui/clean.golangci-lint run ./...— 0 issues.internal/ui35.3% → 56.5%.🤖 Generated with Claude Code
https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc