Skip to content

Commit 624da93

Browse files
committed
test(live-updater): isolate fixture git commands
1 parent 993cbc6 commit 624da93

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎test/scripts/openclaw-live-updater.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ function fetchFixtureMain(checkout: string, remote: string) {
7474
git(checkout, "fetch", origin, `main:refs/remotes/${remote}/main`);
7575
}
7676

77+
async function runFixtureManagedCommand({
78+
args,
79+
bin,
80+
cwd,
81+
env,
82+
}: {
83+
args: string[];
84+
bin: string;
85+
cwd?: string;
86+
env?: NodeJS.ProcessEnv;
87+
}) {
88+
// Fixtures need a real fast-forward, but do not need production process-tree timing.
89+
// Keep that contract in managed-child-process tests so fixture assertions stay isolated.
90+
execFileSync(bin, args, { cwd, env, stdio: "ignore" });
91+
return 0;
92+
}
93+
7794
function maintainFixture(
7895
options: Record<string, unknown>,
7996
dependencies: Record<string, unknown> = {},
@@ -111,6 +128,7 @@ function maintainFixture(
111128
proofSource: "fixture",
112129
}),
113130
readLaunchdEnvironment: () => null,
131+
runManagedCommand: runFixtureManagedCommand,
114132
waitForGatewayProcess: () => {},
115133
...dependencies,
116134
});

0 commit comments

Comments
 (0)