From 307a3b1ad7b1a8e6949022b6c20610ba5c67f69d Mon Sep 17 00:00:00 2001 From: Day Dreamer <87640074+HugoXK@users.noreply.github.com> Date: Sun, 1 Nov 2026 11:12:56 +0800 Subject: [PATCH] test: skip the arch-docs shell-guard case on Windows (#1973) The case can only observe its property by running a fake git that must be an executable script with a #! line; Windows cannot launch one and the bare name is not found on PATH, so the nightly Compatibility job would fail on ENOENT. Marked skipped there, which the log shows as skipped rather than passed; the real gate still runs on windows-latest in the same job's Lint step. No product code. Docs-not-needed: test-only platform guard; install.md's 'Tests for the gate' row still describes core/test/check-arch-docs.test.js and the gate's own behaviour is unchanged (#1973). --- changelog.d/1973-arch-docs-win-guard.fixed.md | 1 + core/test/check-arch-docs.test.js | 7 ++++++- patches/ds-bot/files/test/check-arch-docs.test.js | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 changelog.d/1973-arch-docs-win-guard.fixed.md diff --git a/changelog.d/1973-arch-docs-win-guard.fixed.md b/changelog.d/1973-arch-docs-win-guard.fixed.md new file mode 100644 index 000000000..4a664aa7f --- /dev/null +++ b/changelog.d/1973-arch-docs-win-guard.fixed.md @@ -0,0 +1 @@ +The Windows Compatibility job no longer fails on a test case that can only run on POSIX ([#1973](https://github.com/ThinkFlowLab/FlyBot/issues/1973)): the case proving the arch-docs gate never hands git's arguments to a shell observes that by running a fake `git`, which has to be an executable script with an interpreter line — Windows cannot launch one and would fail the job with `ENOENT`. The case is now marked skipped on Windows rather than quietly passing, and the same job's Lint step still runs the real gate there, so the platform stays covered. diff --git a/core/test/check-arch-docs.test.js b/core/test/check-arch-docs.test.js index c8da557a0..23ed834a3 100644 --- a/core/test/check-arch-docs.test.js +++ b/core/test/check-arch-docs.test.js @@ -65,7 +65,12 @@ test('#1076: the refusal names both places the trailer has to appear', async () assert.match(text, /Docs-not-needed:/); }); -test('the gate never runs git through a shell', async () => { +// #1973: this case can only observe the property by running a fake `git` that has to be an executable +// script with an interpreter line. Windows cannot launch one through CreateProcess, and a bare `git` +// with no `.cmd`/`.exe` is not what PATH lookup finds, so the marker is never written. The case is +// marked skipped there rather than quietly passing: the Windows behaviour is exercised by the real gate +// in nightly.yml's `Lint` step on `windows-latest`. +test('the gate never runs git through a shell', { skip: process.platform === 'win32' }, async () => { // #1954: on Windows `execSync('git rev-parse --verify origin/main^{commit}')` is handed to cmd.exe, // which eats `^`; rev-parse fails and the gate reports "cannot diff against origin/main" on a // checkout where origin/main exists. The gate must pass `^{commit}` to git as one argument, no shell diff --git a/patches/ds-bot/files/test/check-arch-docs.test.js b/patches/ds-bot/files/test/check-arch-docs.test.js index c8da557a0..23ed834a3 100644 --- a/patches/ds-bot/files/test/check-arch-docs.test.js +++ b/patches/ds-bot/files/test/check-arch-docs.test.js @@ -65,7 +65,12 @@ test('#1076: the refusal names both places the trailer has to appear', async () assert.match(text, /Docs-not-needed:/); }); -test('the gate never runs git through a shell', async () => { +// #1973: this case can only observe the property by running a fake `git` that has to be an executable +// script with an interpreter line. Windows cannot launch one through CreateProcess, and a bare `git` +// with no `.cmd`/`.exe` is not what PATH lookup finds, so the marker is never written. The case is +// marked skipped there rather than quietly passing: the Windows behaviour is exercised by the real gate +// in nightly.yml's `Lint` step on `windows-latest`. +test('the gate never runs git through a shell', { skip: process.platform === 'win32' }, async () => { // #1954: on Windows `execSync('git rev-parse --verify origin/main^{commit}')` is handed to cmd.exe, // which eats `^`; rev-parse fails and the gate reports "cannot diff against origin/main" on a // checkout where origin/main exists. The gate must pass `^{commit}` to git as one argument, no shell