Skip to content

fix(affected): exclude fixture paths from the test-file heuristic#36

Merged
solomonneas merged 3 commits into
masterfrom
fix/affected-fixture-classification
Jul 17, 2026
Merged

fix(affected): exclude fixture paths from the test-file heuristic#36
solomonneas merged 3 commits into
masterfrom
fix/affected-fixture-classification

Conversation

@solomonneas

Copy link
Copy Markdown
Contributor

What

affected reported fixture sources as runnable tests: tests/fixtures/golden/mixed/src/bin/graphtrail-mcp.rs came back in affected_tests because is_test_file counts any path with a tests-like segment. Paths under fixtures/, fixture/, golden/, snapshots/, or testdata/ are now non-tests unless the file name itself matches a test-name pattern. testdata also leaves the generic test-dir list (Go fixture convention).

dead_code filtered candidates with the same predicate, which would have let fixture symbols (intentionally uncalled) flood the candidate list - on this repo, 8 of 60 candidates. It now filters through a broader test-support predicate (tests or fixture dirs), keeping fixtures out of both reports for opposite reasons: not runnable tests for affected, not dead code for dead_code.

Why

An affected-test calibration bench over 17 historical commits of this repo (receipts in benchmarks/affected-calibration/) surfaced the misclassification. The same bench returned a null result on traversal depth: recall identical at depth 1/3/5, so the depth default stays.

Verification

cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-features, cargo build --release (Brigade receipts). E2E on the bench corpus: affected src/store/db.rs src/mcp.rs no longer lists the fixture file; dead-code candidates drop 60 to 52 with 0 fixture paths.

solomonneas and others added 3 commits July 17, 2026 15:55
Paths under fixtures/, golden/, snapshots/, or testdata/ are no longer
classified as tests solely because they sit under a test directory segment.
Name-based patterns (test_*, *_test.*, *.test.*, *.spec.*) still apply.

Co-authored-by: Cursor <cursoragent@cursor.com>
The fixture reclassification in is_test_file would have let fixture
sources (intentionally uncalled) surface as dead-code candidates.
dead_code now filters through a broader test-support predicate covering
test and fixture directories.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 92e0c5e1-6118-482c-81d2-a55c6c7357a0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/affected-fixture-classification

Comment @coderabbitai help to get the list of available commands.

@solomonneas
solomonneas merged commit 8c52dfb into master Jul 17, 2026
10 checks passed
@solomonneas solomonneas self-assigned this Jul 17, 2026
@solomonneas solomonneas mentioned this pull request Jul 17, 2026
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.

1 participant