From 7f6c9ab1ae6173923bf30ae184665c0fb4765494 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 14 May 2026 21:05:22 -0700 Subject: [PATCH] test(windows): skip Unix-only cases on Windows runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit windows-free-tests on GitHub free windows-latest fails three cases that depend on Unix tooling the runner doesn't have: 1. `setup-windows-fallback.test.ts` behavior matrix — IS_WINDOWS=0 cells assert `ln -snf` produces a real symlink. On Windows-without-Developer- Mode (which the free `windows-latest` runner is), `ln -snf` silently creates a file copy. That's literally the bug `_link_or_copy` exists to work around, so the assertion can never pass there. Skip the whole describe block on win32. The static-invariant test (zero raw `ln` outside the helper body) above the matrix still runs and pins the shape the Windows install relies on. 2. `docs-config-keys.test.ts` round-trip — spawnSync(`bin/gstack-config`) on Windows doesn't read the bash shebang and fails to exec. Skip on win32; the deprecated-key denylist test in the same file still runs and is the actual invariant defending the v1.27.0.0 rename at the doc layer. Use `describe.skipIf(process.platform === 'win32', ...)` and `test.skipIf(process.platform === 'win32', ...)`. Tests still run on macOS and Linux unchanged. Co-Authored-By: Claude Opus 4.7 --- test/docs-config-keys.test.ts | 6 +++++- test/setup-windows-fallback.test.ts | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/docs-config-keys.test.ts b/test/docs-config-keys.test.ts index 2ced29d6e..9fcfc787b 100644 --- a/test/docs-config-keys.test.ts +++ b/test/docs-config-keys.test.ts @@ -61,7 +61,11 @@ describe('docs ↔ gstack-config key drift guard', () => { expect(stale).toEqual([]); }); - test('`gstack-config get artifacts_sync_mode` returns a value (the rename landed)', () => { + // gstack-config is a bash script; Windows can't exec it via spawnSync + // without a Git Bash interpreter shim. Skip on Windows — the deprecated-key + // denylist test above already pins the v1.27.0.0 rename behavior at the + // doc layer, which is the actual invariant this wave defends. + test.skipIf(process.platform === 'win32')('`gstack-config get artifacts_sync_mode` returns a value (the rename landed)', () => { // Run from a clean HOME so the user's local config doesn't pollute. const tmpHome = fs.mkdtempSync(path.join(require('os').tmpdir(), 'gstack-cfg-')); try { diff --git a/test/setup-windows-fallback.test.ts b/test/setup-windows-fallback.test.ts index 6c3735860..cc04fbbd7 100644 --- a/test/setup-windows-fallback.test.ts +++ b/test/setup-windows-fallback.test.ts @@ -57,7 +57,13 @@ describe('setup: _link_or_copy invariant (D7)', () => { }); }); -describe('setup: _link_or_copy helper — behavior matrix', () => { +// Behavior matrix uses Unix `ln -snf` semantics in the IS_WINDOWS=0 cells. +// On Windows-without-Developer-Mode (e.g. GitHub's free `windows-latest` +// runner), `ln -snf` silently produces a file copy rather than a symlink — +// that's literally the bug this helper exists to work around. Skip the whole +// matrix on Windows; the static-invariant tests above already pin the helper +// shape that the Windows install relies on. +describe.skipIf(process.platform === 'win32')('setup: _link_or_copy helper — behavior matrix', () => { // Source the helper into a temp shell with IS_WINDOWS set and exercise // each cell of the file/dir × Windows/Unix matrix. function runHelper(