Registry Mirror
Skip to content

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

On Windows, vp run check:changed counted one changed test file twice and passed it twice to vitest (or to node --test for .github/scripts). Git reports the file with /, and the sibling-test scan found it again with \\.

  • The sibling-test scan now records paths with forward slashes, the same way git reports them.
  • splitTests converts paths to forward slashes and removes duplicates, so each test runs and is counted once.

Fixes #47872

Reproduction on main

Commit: origin/main 3336974. (1) Linux, node with the pinned toolchain: splitTests(new Set(['scripts/check-changed.test.ts', path.win32.join('scripts','check-changed.test.ts')])) returns vitestTests ['scripts/check-changed.test.ts', 'scripts\check-changed.test.ts']. (2) Real run on a Windows Server 2025 machine: a fresh worktree at 3336974, vp i, appended a comment line to scripts/check-changed.test.ts (git status shows exactly that one file modified), then vp run check:changed. The gate printed vp test (2 files) / pass test (2 files) for that single changed test. Git gave the forward-slash path, and the sibling scan's path.join gave the backslash path. (3) Failing test pushed to factory/repro-47872 (15e0965): a new case in scripts/check-changed.test.ts that feeds splitTests the / and \ spellings of one vitest file and one .github/scripts node:test file, and expects one of each. It fails on main and shows both spellings retained.

Evidence

On Windows Server 2025 with pinned Node 26.13.1 / pnpm 12.14.0, install each commit in a fresh worktree. Append one comment to scripts/check-changed.test.ts, confirm it is the only changed file, and run vp run check:changed HEAD. Restore it and repeat with .github/scripts/test-delta.test.cjs. The explicit HEAD ref isolates the same one-file edit on each commit. All four commands exited 0.

The base reports two test paths for each single changed test; the fix reports one. Captures show actual command transcript excerpts in Windows Terminal, with matching crops, theme, and desktop viewport. Both sides were visually inspected and stable across screenshots 500 ms apart.

Before After
33369749ea 2a3a1288dc
Before: one changed file incorrectly counts as two test paths After: one changed file counts as one test path
Vitest transcript, node:test transcript Vitest transcript, node:test transcript

Reproduction driver · Transcript display script. Transcripts redact private checkout paths.

Tests

  • vp test run scripts/check-changed.test.ts: 20 passed; the new separator case failed before the fix
  • vp run typecheck: 43/43 successful
  • vp run check:changed: format, lint, knip, typecheck and test (1 file) all pass
  • PR CI at 2a3a128: all checks passed or were skipped

Not in this change

  • NODE_TEST still accepts \\ as a separator. That is now redundant because splitTests normalises paths first, but it is harmless.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits December 3, 2026 00:08
…tors

Reproduces #47872: a test reported by git with / and found by the sibling
scan with \ on Windows is passed and counted twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sibling-test scan joined paths with the platform separator, so on
Windows a changed test reached the Set as both `scripts/x.test.ts` (git)
and `scripts\x.test.ts` (scan) and was counted and run twice. The scan
now adds forward-slash paths, and splitTests normalises and dedupes what
it hands to vitest and node --test.

Fixes #47872

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macroscopeapp

macroscopeapp Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2a3a128

Macroscope's review found this PR approvable — The script normalizes Windows test paths and deduplicates them before selecting test runners. This is a limited developer-tooling change with no product-default or diagnostic-suppression changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changed-test script now normalizes Windows path separators before adding adjacent tests and before deduplicating test paths. Tests cover mixed-separator inputs for Vitest and Node tests.

Changes: Test path normalization

Layer / File(s) Summary
Normalize test paths before classification
scripts/check-changed.ts, scripts/check-changed.test.ts
Adjacent test paths and paths passed to splitTests use forward slashes. Tests verify normalized outputs and deduplication when the same test path uses both separator styles.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to 2a3a1

This change makes the changed-file check count and pass each test only once when Windows path separators are mixed. It only affects development tooling, and no merge-blocking risk is apparent.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: check:changed on Windows passes each changed test once. It matches the summary of splitTests normalizing paths and removing duplicates, and the sibling-test scan now record…
Linked Issues check Passed [#47872] requires that check:changed count and pass one path per unique test when Git and the sibling-test scan use different separators. The reviewed diff of scripts/check-changed.ts (base 3336974…
Out of Scope Changes check Passed All changed code is in scripts/check-changed.ts (splitTests normalization and sibling-test path normalization) and scripts/check-changed.test.ts (the regression test, per the summary). Both directly i…
Description check Passed The description covers the problem (Windows double-counting of one changed test file, with the path-separator mismatch), the change (forward-slash normalization in the sibling scan and deduplication i…
Full details: Title check

Explanation

The title names the change: check:changed on Windows passes each changed test once. It matches the summary of splitTests normalizing paths and removing duplicates, and the sibling-test scan now recording forward-slash paths. The title uses the conventional commit format and is specific to the bug.

Full details: Linked Issues check

Explanation

[#47872] requires that check:changed count and pass one path per unique test when Git and the sibling-test scan use different separators. The reviewed diff of scripts/check-changed.ts (base 3336974 to head 2a3a128) shows two changes. First, splitTests now maps each entry with replaceAll("\", "/") and wraps the result in a Set before filtering into vitestTests and nodeTests. Second, the sibling-test scan in checkChanged normalizes path.join(dir, entry) to forward slashes before tests.add. Together these produce one forward-slash path per test, which covers both the Vitest and the node:test (.github/scripts) branches. The PR summary and raw summary report a new test in scripts/check-changed.test.ts that feeds both spellings and expects one entry each. I could not read the test file diff, so that test's content is established only by the summary and PR description, not by direct inspection. The reported runs (1 failed before the fix, 20 passed after) support it. The code change alone addresses the requirement. The Evidence section is a placeholder and covers no coding requirement.

Full details: Out of Scope Changes check

Explanation

All changed code is in scripts/check-changed.ts (splitTests normalization and sibling-test path normalization) and scripts/check-changed.test.ts (the regression test, per the summary). Both directly implement the objective in [#47872]. The PR description's notes on NODE_TEST and the unfilled Evidence section are documentation or process content, not code changes. I found no unrelated code changes. I could not read the test file diff, so its contents are not verified directly.

Full details: Description check

Explanation

The description covers the problem (Windows double-counting of one changed test file, with the path-separator mismatch), the change (forward-slash normalization in the sibling scan and deduplication in splitTests), the scope (links issue #47872), and verification (unit test run, typecheck, check:changed, and a Windows reproduction with before/after transcripts). It also notes what is out of scope and names the model and harness used. It follows the template's section structure. The Verification section is detailed, and the Scope section links the bug report, so the required information is present.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7f08ea6 and 2a3a128.

Files selected for processing: 2

  • scripts/check-changed.test.ts
  • scripts/check-changed.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@juliusmarminge
juliusmarminge merged commit 0dd30d0 into main Dec 3, 2026
31 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-47872 branch December 3, 2026 01:13
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.

[Bug]: check:changed counts duplicate Windows test paths

1 participant