Skip to content

test(cache): remove glob input tests that a stronger neighbour covers - #934

Open
Brooooooklyn wants to merge 1 commit into
mainfrom
claude/prune-tests-glob-dedup-test
Open

Brooooooklyn wants to merge 1 commit into
mainfrom
claude/prune-tests-glob-dedup-test

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Requested by Brooklyn · project thread

Before: three compute_globbed_inputs unit tests in crates/vt/src/session/execute/glob.rs could not fail on any regression without a neighbouring test failing on it too.

After: those three tests are gone. Every behaviour they asserted is still asserted by another test in the same module. Only #[cfg(test)] code changes.

How: each removal was defended by mutating glob.rs with the most realistic regression the test could catch, running all vt lib tests, and reverting. The key mutations were re-run after the deletion.

Totals

  • Files touched: 1 (test module only).
  • Cases deleted: 3 of 79 vt lib tests (76 after). Only the vt lib suite was counted, not the whole workspace.
  • Cases folded: 0.
  • Net lines: −42 (+0 / −42).
  • Runtime saved: about 16 ms, the summed duration of the deleted cases.

Removals

  1. test_overlapping_positive_globs_deduplicates: the result is a BTreeMap, so a file matched by two globs can't be counted twice. Dropping the Entry::Vacant check and always inserting passes every test, this one included. The only regression it does catch, ignoring negative globs, also fails 5 other tests. Merging several positive globs stays covered by test_positive_with_negative_exclusion and test_multiple_positive_globs.
  2. test_empty_positive_globs_returns_empty: the same call as test_negative_only_returns_empty without the negative glob, with the same assertion. Treating an empty positive set as ** fails both, and fails test_negative_only_returns_empty after the deletion.
  3. test_sibling_positive_glob_matches_sibling_package: globs reaching this function are already workspace-root-relative, so "sibling package" means nothing to it. test_sibling_negative_glob_excludes_from_sibling asserts the same file (packages/shared/src/utils.ts) with a wider glob. Stripping a trailing /** fails both, and after the deletion still fails 2 tests.

Mutations (all in glob.rs, each reverted)

Change Tests that failed
always insert (no Entry::Vacant check) none
walk only the first positive glob test_multiple_positive_globs, test_multiple_negative_globs
ignore negative globs 6 before, 5 after
skip patterns without * test_file_hashes_change_with_content, test_multiple_positive_globs
Break instead of Continue on an already-hashed file none (see below)
strip a trailing /** 3 before, 2 after
remove the positive_globs.is_empty() early return none (the loop over an empty set does nothing)
empty positive globs become ** 2 before, 1 after

Gap found, not fixed here: returning ControlFlow::Break instead of Continue for a file already hashed by an earlier pattern passes every vt lib test, on main too. With that regression, overlapping globs silently drop later files from the fingerprint. A test with overlapping globs plus a unique file that sorts after them would catch it.

What ran and what did not

  • Ran on Linux at c6c91f96 and on this branch: cargo test -p vt --lib (0 failures before and after), the mutations above, cargo fmt --check, cargo clippy -p vt --tests -- -D warnings and git diff --check, all clean.
  • Not run: workspace-wide just test and just lint, macOS and Windows, the e2e/snapshot suites, and vt_subprocess_test / vt_pty_terminal.

Open pull requests: none of the 57 open touches glob.rs.

Ages: all three tests were added in #104 on 2026-03-09. None was added for a bug, and none is in a permission or security suite.

To revert: git revert 23630f0c.


Generated by Claude Code

Three `compute_globbed_inputs` unit tests can't fail on a regression
that another test in the module doesn't also catch:

- `test_overlapping_positive_globs_deduplicates`: the result is a
  `BTreeMap`, so an overlapping file can't be counted twice. Dropping the
  `Entry::Vacant` check passes it; ignoring negative globs fails it and
  four other tests.
- `test_empty_positive_globs_returns_empty`: same call as
  `test_negative_only_returns_empty` without the negative glob. Treating
  empty positive globs as `**` fails both.
- `test_sibling_positive_glob_matches_sibling_package`: globs are
  workspace-root-relative here, so "sibling" means nothing to this
  function; `test_sibling_negative_glob_excludes_from_sibling` asserts
  the same file with a wider glob. Stripping a trailing `/**` fails both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf
@Brooooooklyn Brooooooklyn self-assigned this Nov 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T17:50:24.927305Z 23630f0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  -0.46%  [ -5.75% ..  +4.11%]  overhead   +49.59%
dynamic/access             change  -0.01%  [ -1.20% ..  +0.65%]  overhead    +8.16%
dynamic/access-relative    change  -0.10%  [ -1.04% ..  +0.79%]  overhead   +48.97%
dynamic/access-contended   change  +0.00%  [ -2.16% ..  +2.45%]  overhead   +11.43%
static/launch              change  +0.12%  [ -6.86% ..  +7.27%]  overhead  +150.76%
static/access              change  +0.17%  [ -1.21% ..  +1.64%]  overhead  +815.84%
static/access-relative     change  -0.02%  [ -1.14% ..  +1.16%]  overhead +1329.30%
static/access-contended    change  -0.26%  [ -1.37% ..  +1.21%]  overhead +3484.40%

macos

dynamic/launch             change  -0.14%  [ -2.38% ..  +2.60%]  overhead  +222.30%
dynamic/access             change  -0.40%  [ -4.26% ..  +3.37%]  overhead    +2.93%
dynamic/access-relative    change  +0.11%  [ -1.67% ..  +2.48%]  overhead  +276.17%
dynamic/access-contended   change  +0.47%  [ -2.37% ..  +2.53%]  overhead    +3.71%

windows

dynamic/launch             change  -0.65%  [ -7.65% ..  +5.84%]  overhead   +27.97%
dynamic/access             change  +0.00%  [ -1.02% ..  +1.21%]  overhead    +1.64%
dynamic/access-relative    change  -0.20%  [ -1.01% ..  +0.61%]  overhead    +1.61%
dynamic/access-contended   change  +2.08%  [ -2.82% .. +15.12%]  overhead    +2.58%

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants