mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-17 07:10:12 +02:00
test(windows): skip Unix-only cases on Windows runner
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user