From 26aaea2eb0e00551727fc9f7cc978d91a0696efa Mon Sep 17 00:00:00 2001 From: tranthanhnhatkhoa Date: Sat, 8 Aug 2026 13:28:28 +0200 Subject: [PATCH] test(host-config): skip the claude-detect case when claude is not on PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `detect` reports hosts whose binaries are on PATH, so asserting it finds claude is an assertion about the machine, not about the code. It holds in CI and in a developer's own session. It does not hold when the suite runs as a service account, or anywhere claude is installed under a different user — /root/.local/bin/claude is not on a non-root PATH. test.skipIf (already used in diagram-render-drift, setup-windows-fallback and gbrain-sync-voyage-code-3-integration) keeps the check where it is meaningful and skips it where it can only report the environment. Coverage in CI is unchanged: claude is on PATH there, so it still runs. Renamed to drop "since we are running in claude", which is the assumption that turned out not to be universal. Verified: claude absent (this box) 76 pass, 1 skip, 0 fail fake claude on PATH test runs and passes --- test/host-config.test.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/host-config.test.ts b/test/host-config.test.ts index 1c939d7be..c9ca9b955 100644 --- a/test/host-config.test.ts +++ b/test/host-config.test.ts @@ -401,10 +401,17 @@ describe('host-config-export.ts CLI', () => { expect(exitCode).toBe(1); }); - test('detect finds claude (since we are running in claude)', () => { + // `detect` reports the hosts whose binaries are on PATH, so asserting it + // finds claude is really an assertion about the machine. That holds in CI and + // in a developer's own session; it does not hold when the suite runs as a + // service account, or anywhere claude is installed for a different user. + // Skipping there keeps the suite runnable off a dev box without weakening the + // check where it is meaningful — it still runs wherever claude is present. + const claudeOnPath = Bun.which('claude') !== null; + + test.skipIf(!claudeOnPath)('detect finds claude (when claude is on PATH)', () => { const { stdout, exitCode } = run('detect'); expect(exitCode).toBe(0); - // claude binary should be on PATH in this environment expect(stdout).toContain('claude'); });