test(e2e): repair OpenShell prerelease smoke

This commit is contained in:
Peter Steinberger
2026-04-12 19:24:50 +01:00
parent afb28631a5
commit cfd5f9e4e3
2 changed files with 20 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ async function runCommand(params: {
args: string[];
cwd?: string;
env?: NodeJS.ProcessEnv;
stdin?: string | Buffer;
stdin?: string | Uint8Array;
allowFailure?: boolean;
timeoutMs?: number;
}): Promise<ExecResult> {
@@ -117,7 +117,21 @@ async function commandAvailable(command: string): Promise<boolean> {
allowFailure: true,
timeoutMs: 20_000,
});
return result.code === 0 || result.stdout.length > 0 || result.stderr.length > 0;
return result.code === 0;
} catch {
return false;
}
}
async function openshellGatewayAvailable(command: string): Promise<boolean> {
try {
const result = await runCommand({
command,
args: ["gateway", "start", "--help"],
allowFailure: true,
timeoutMs: 20_000,
});
return result.code === 0 && `${result.stdout}\n${result.stderr}`.includes("--name");
} catch {
return false;
}
@@ -338,6 +352,9 @@ describe("openshell sandbox backend e2e", () => {
if (!(await commandAvailable(OPENCLAW_OPENSHELL_COMMAND))) {
return;
}
if (!(await openshellGatewayAvailable(OPENCLAW_OPENSHELL_COMMAND))) {
return;
}
const rootDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-openshell-e2e-"));
const env = openshellEnv(rootDir);