You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
…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>
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
[#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
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
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
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.
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
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.
On Windows,
vp run check:changedcounted one changed test file twice and passed it twice to vitest (or tonode --testfor.github/scripts). Git reports the file with/, and the sibling-test scan found it again with\\.splitTestsconverts 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), thenvp run check:changed. The gate printedvp 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 runvp run check:changed HEAD. Restore it and repeat with.github/scripts/test-delta.test.cjs. The explicitHEADref 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.
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 fixvp run typecheck: 43/43 successfulvp run check:changed: format, lint, knip, typecheck and test (1 file) all passNot in this change
NODE_TESTstill accepts\\as a separator. That is now redundant becausesplitTestsnormalises paths first, but it is harmless.Who did the work
Run by the t3code factory in T3 Code.