mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 16:23:55 +02:00
test(e2e): repair OpenShell prerelease smoke
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user