diff --git a/.changeset/graceful-wasps-caper.md b/.changeset/graceful-wasps-caper.md new file mode 100644 index 000000000..a0eadf8dd --- /dev/null +++ b/.changeset/graceful-wasps-caper.md @@ -0,0 +1,5 @@ +--- +type: Fixed +pr: 1927 +--- +**bug-1367 install test no longer fails on Windows CI when hooks/dist isn't pre-built** — the test ran install.js without building its hooks/dist precondition (a gitignored build artifact the unit lane doesn't build), so on a lane without pre-built hooks the installer hit "Failed to install hooks: directory is empty" and the before-hook threw. The test now builds hooks in its own before() (mirroring golden-install-parity). (#1926) diff --git a/tests/bug-1367-claude-local-flat-command-layout.test.cjs b/tests/bug-1367-claude-local-flat-command-layout.test.cjs index 02ab787fc..e333139ca 100644 --- a/tests/bug-1367-claude-local-flat-command-layout.test.cjs +++ b/tests/bug-1367-claude-local-flat-command-layout.test.cjs @@ -33,6 +33,11 @@ const { cleanup } = require('./helpers.cjs'); const REPO_ROOT = path.resolve(__dirname, '..'); const INSTALL_PATH = path.join(REPO_ROOT, 'bin', 'install.js'); +// hooks/dist/ is a gitignored build artifact; the test must ensure it exists before +// invoking the installer (mirrors golden-install-parity's BUILD_SCRIPT pattern). Without +// this, the unit lane — whose ensureBuiltArtifacts() builds only bin/lib, not hooks — +// leaves hooks/dist empty and install.js hard-fails "directory is empty" (#1926). +const BUILD_HOOKS = path.join(REPO_ROOT, 'scripts', 'build-hooks.js'); // --------------------------------------------------------------------------- // Helpers @@ -61,6 +66,13 @@ describe('bug #1367 — Claude local install uses flat gsd-.md command layo let tmpDir; before(() => { + // #1926: build hooks/dist/ so the installer's verifyInstalled(hooks) doesn't hit an + // empty directory. Self-contained — no dependency on the lane having pre-built hooks. + execFileSync(process.execPath, [BUILD_HOOKS], { + cwd: REPO_ROOT, + encoding: 'utf-8', + stdio: ['pipe', 'pipe', 'pipe'], + }); tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-1367-')); runClaudeLocalInstall(tmpDir); });