From 5d7377670222f51ab3167f996022de08f90a46d7 Mon Sep 17 00:00:00 2001 From: Daniil Koryto Date: Fri, 10 Apr 2026 15:20:35 +0300 Subject: [PATCH 1/2] Fix host platform defaults in node-backed test harness --- test/install/context.test.ts | 12 ++++++++++++ test/install/test-deps.ts | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/test/install/context.test.ts b/test/install/context.test.ts index 79037d0..a1947d9 100644 --- a/test/install/context.test.ts +++ b/test/install/context.test.ts @@ -103,6 +103,18 @@ test("resolveInstallContext supports native Windows paths and Git Bash cwd input ); }); +test("integration harness keeps the host runtime platform for node-backed dependencies", async () => { + const harness = await createInstallIntegrationHarness(); + + try { + const dependencies = harness.createDependencies(); + + assert.equal(dependencies.runtime.platform, process.platform); + } finally { + await harness.cleanup(); + } +}); + test( "resolveInstallContext assembles project, platform, version, and managed path context without using real machine paths", { skip: process.platform === "win32" }, diff --git a/test/install/test-deps.ts b/test/install/test-deps.ts index 9985fb1..c7699f1 100644 --- a/test/install/test-deps.ts +++ b/test/install/test-deps.ts @@ -520,13 +520,19 @@ export function createStubbedTestInstallDependencies( export function createNodeBackedTestInstallDependencies( overrides: CreateNodeInstallDependenciesOverrides = {}, ): InstallDependencies { + const runtimeOverrides = Object.fromEntries( + Object.entries(overrides.runtime ?? {}).filter( + ([, value]) => value !== undefined, + ), + ) as InstallRuntimeOverrides; + return createNodeInstallDependencies({ clock: overrides.clock, commands: overrides.commands, fs: overrides.fs, input: overrides.input, prompts: overrides.prompts, - runtime: createTestInstallRuntime(overrides.runtime), + runtime: runtimeOverrides, }); } From bcc4f387767f61cea9cc10270bc6fcb7f4c8a046 Mon Sep 17 00:00:00 2001 From: Daniil Koryto Date: Fri, 10 Apr 2026 15:35:00 +0300 Subject: [PATCH 2/2] Skip POSIX rerun permission check on Windows hosts --- test/install/rerun.test.ts | 83 +++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/test/install/rerun.test.ts b/test/install/rerun.test.ts index dff8a82..cfb9681 100644 --- a/test/install/rerun.test.ts +++ b/test/install/rerun.test.ts @@ -19,6 +19,7 @@ import { createInstallIntegrationHarness } from "./harness.js"; const MODEL_KEY = "qwen3-235b-a22b-instruct-2507-fp8" as const; const MODEL_REF = formatOpencodeModelRef(MODEL_KEY); const SECOND_RUN_BACKUP_TIMESTAMP = "20260409T110000Z"; +const SKIP_POSIX_HOST_INTEGRATION = process.platform === "win32"; type InstallScope = "project" | "user"; type InstallerFixture = Awaited>; @@ -281,44 +282,50 @@ test("no-op rerun in user scope keeps managed config stable and skips new backup } }); -test("no-op rerun in user scope repairs drifted POSIX secret permissions without creating a new backup", async () => { - const fixture = await createInstallerFixture(); - - try { - const firstResult = await runScopedInstall(fixture, "user", { - clockIso: "2026-04-09T10:00:00.000Z", - }); - - assert.equal(firstResult.status, "success"); - - await chmod(fixture.managedPaths.secretPath, 0o644); - await chmod(dirname(fixture.managedPaths.secretPath), 0o755); - - const beforeManagedState = await snapshotManagedState(fixture); - - const secondResult = await runScopedInstall(fixture, "user", { - clockIso: "2026-04-09T11:00:00.000Z", - }); - - assert.equal(secondResult.status, "success"); - await assertManagedStateUnchanged(fixture, beforeManagedState, ["secret"]); - await assertBackupMissing( - fixture, - fixture.managedPaths.secretPath, - SECOND_RUN_BACKUP_TIMESTAMP, - ); - assert.equal( - (await stat(fixture.managedPaths.secretPath)).mode & 0o777, - 0o600, - ); - assert.equal( - (await stat(dirname(fixture.managedPaths.secretPath))).mode & 0o777, - 0o700, - ); - } finally { - await fixture.harness.cleanup(); - } -}); +test( + "no-op rerun in user scope repairs drifted POSIX secret permissions without creating a new backup", + { skip: SKIP_POSIX_HOST_INTEGRATION }, + async () => { + const fixture = await createInstallerFixture(); + + try { + const firstResult = await runScopedInstall(fixture, "user", { + clockIso: "2026-04-09T10:00:00.000Z", + }); + + assert.equal(firstResult.status, "success"); + + await chmod(fixture.managedPaths.secretPath, 0o644); + await chmod(dirname(fixture.managedPaths.secretPath), 0o755); + + const beforeManagedState = await snapshotManagedState(fixture); + + const secondResult = await runScopedInstall(fixture, "user", { + clockIso: "2026-04-09T11:00:00.000Z", + }); + + assert.equal(secondResult.status, "success"); + await assertManagedStateUnchanged(fixture, beforeManagedState, [ + "secret", + ]); + await assertBackupMissing( + fixture, + fixture.managedPaths.secretPath, + SECOND_RUN_BACKUP_TIMESTAMP, + ); + assert.equal( + (await stat(fixture.managedPaths.secretPath)).mode & 0o777, + 0o600, + ); + assert.equal( + (await stat(dirname(fixture.managedPaths.secretPath))).mode & 0o777, + 0o700, + ); + } finally { + await fixture.harness.cleanup(); + } + }, +); test("repeated project-scope reruns stay stable while refreshing install-state only", async () => { const fixture = await createInstallerFixture();