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