Skip to content

Comments

test: add 116 integration tests closing dispatch-layer blind spot#169

Merged
rocketman-code merged 7 commits intomainfrom
test/overhaul-160
Feb 22, 2026
Merged

test: add 116 integration tests closing dispatch-layer blind spot#169
rocketman-code merged 7 commits intomainfrom
test/overhaul-160

Conversation

@rocketman-code
Copy link
Owner

@rocketman-code rocketman-code commented Feb 22, 2026

Summary

  • Add 116 new integration tests across 8 test files, growing the suite from ~344 to 460 tests
  • Closes the dispatch-layer blind spot that let 11 bugs ship undetected in v0.4.0
  • Every new test file compiles as a separate integration test crate (in tests/), testing the public API without #[cfg(test)]
  • Fix worktree-incompatible .git/ hardcoded paths in xtask hooks and perf_validate (fix(xtask): perf attestation fails in git worktrees #170)

New Test Files

File Tests Covers Issue
tests/cli.rs 21 End-to-end CLI via assert_cmd #161
tests/session_reports.rs 21 Session report methods with flag combos #162
tests/json_roundtrip.rs 5 JSON schema validation for all report types #163
tests/git_refs.rs 14 Git ref classification edge cases #164
tests/cache_safety.rs 2 Cache corruption regression guards #165
tests/negative_cases.rs 29 Negative/edge-case tests for all parsers #166
tests/property.rs 4 Property-based parser fuzz tests (proptest) #167
tests/report_battery.rs 20 Macro-generated test battery for all reports #168
tests/common/mod.rs Shared TestProject fixture

Worktree Fix

xtask/src/hooks.rs and xtask/src/perf_validate.rs hardcoded .git/perf-attestation.json and .git/hooks/, which breaks in git worktrees where .git is a file, not a directory. Added git_dir() helper using git rev-parse --git-dir to resolve the correct worktree-specific git directory.

What This Would Have Caught

8 of the 11 v0.4.0 bugs would have been caught by these tests:

Test plan

  • cargo xtask check passes (fmt + clippy + 460 tests)
  • cargo bench -- session_trace_cached_ts shows no regression (-0.6%, p=0.57)
  • Pre-push hook passes in worktree (validates the hook fix)

Depends on: #153, #154, #155, #156, #157, #158, #159

Closes #160, #161, #162, #163, #164, #165, #166, #167, #168, #170

rocketman-code added a commit that referenced this pull request Feb 22, 2026
Remove duplicate "You can now push." message in perf_validate.
Replace std::mem::forget(TempDir) with proper ownership in session_reports tests.
…h parse_flags

Add --json branching to all REPL dispatch functions (trace, chain, cut,
diff, packages, imports, importers). Return errors for unknown flags
instead of silently ignoring them. Route imports/importers commands
through parse_flags for consistent flag handling.
… prevent cache pollution

Replace process::exit(1) with Error::MaxWeightExceeded for proper error
propagation. Add --json output support for --diff-from. Use no_cache=true
for working-tree snapshots during diff to prevent overwriting git-tree cache.
…_arg

Reorder classify_diff_arg to check file existence before git ref
resolution. Add tests for annotated tags, slashed branch names
(feature/auth), and ambiguity resolution (file beats branch).
Return direct_import: false when the target module is not found in the
graph, instead of vacuously returning true.
Rename size -> total_size_bytes, files -> file_count to match the naming
convention used by other report types.
Add 8 new integration test files exercising the public API end-to-end:
cli.rs (21), session_reports.rs (21), json_roundtrip.rs (5),
git_refs.rs (14), cache_safety.rs (2), negative_cases.rs (29),
property.rs (4), report_battery.rs (20). Shared TestProject fixture
in common/mod.rs provides diamond dependency graph with static, dynamic,
and type-only edges plus a third-party package.
Replace hardcoded .git/ paths with git_dir() helper that resolves the
correct directory in both normal repos and git worktrees where .git
is a file pointer.
@rocketman-code rocketman-code changed the title test: add 154 integration tests closing dispatch-layer blind spot test: add 116 integration tests closing dispatch-layer blind spot Feb 22, 2026
@rocketman-code rocketman-code merged commit eb75960 into main Feb 22, 2026
8 checks passed
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.

test: overhaul test coverage to close dispatch-layer blind spot

1 participant