test: add 116 integration tests closing dispatch-layer blind spot#169
Merged
rocketman-code merged 7 commits intomainfrom Feb 22, 2026
Merged
test: add 116 integration tests closing dispatch-layer blind spot#169rocketman-code merged 7 commits intomainfrom
rocketman-code merged 7 commits intomainfrom
Conversation
bc6691e to
91f01ae
Compare
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.
5eb39a8 to
6986267
Compare
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
tests/), testing the public API without#[cfg(test)].git/hardcoded paths in xtask hooks and perf_validate (fix(xtask): perf attestation fails in git worktrees #170)New Test Files
tests/cli.rstests/session_reports.rstests/json_roundtrip.rstests/git_refs.rstests/cache_safety.rstests/negative_cases.rstests/property.rstests/report_battery.rstests/common/mod.rsTestProjectfixtureWorktree Fix
xtask/src/hooks.rsandxtask/src/perf_validate.rshardcoded.git/perf-attestation.jsonand.git/hooks/, which breaks in git worktrees where.gitis a file, not a directory. Addedgit_dir()helper usinggit rev-parse --git-dirto 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:
cache_safety.rsverifies trace-diff-trace produces identical resultssession_reports.rstests JSON output from all report methodsnegative_cases.rsverifies unknown flags produce errorsgit_refs.rstests annotated tags, slashed branchesgit_refs.rstests feature/auth style branchessession_reports.rstests imports/importers methodscli.rstests --max-weight exceeded returns errorcli.rstests diff-from with JSON outputsession_reports.rstests cut_report with nonexistent targetjson_roundtrip.rsvalidates all field names match specTest plan
cargo xtask checkpasses (fmt + clippy + 460 tests)cargo bench -- session_trace_cached_tsshows no regression (-0.6%, p=0.57)Depends on: #153, #154, #155, #156, #157, #158, #159
Closes #160, #161, #162, #163, #164, #165, #166, #167, #168, #170