mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:20:43 +00:00
test: extend Parallels model smoke timeout
This commit is contained in:
@@ -101,6 +101,8 @@ const defaultOptions = (): LinuxOptions => ({
|
||||
vmNameExplicit: false,
|
||||
});
|
||||
|
||||
const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300);
|
||||
|
||||
function usage(): string {
|
||||
return `Usage: bash scripts/e2e/parallels-linux-smoke.sh [options]
|
||||
|
||||
@@ -672,6 +674,14 @@ rm -rf /root/.openclaw/test-bad-plugin`);
|
||||
|
||||
private verifyLocalTurn(): void {
|
||||
this.guestExec(["openclaw", "models", "set", this.auth.modelId]);
|
||||
this.guestExec([
|
||||
"openclaw",
|
||||
"config",
|
||||
"set",
|
||||
`models.providers.${this.options.provider}.timeoutSeconds`,
|
||||
String(agentModelTimeoutSeconds),
|
||||
"--strict-json",
|
||||
]);
|
||||
this.guestExec([
|
||||
"openclaw",
|
||||
"config",
|
||||
|
||||
@@ -95,6 +95,7 @@ const guestOpenClaw = "/opt/homebrew/bin/openclaw";
|
||||
const guestOpenClawEntry = "/opt/homebrew/lib/node_modules/openclaw/openclaw.mjs";
|
||||
const guestNode = "/opt/homebrew/bin/node";
|
||||
const guestNpm = "/opt/homebrew/bin/npm";
|
||||
const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300);
|
||||
|
||||
const defaultOptions = (): MacosOptions => ({
|
||||
discordChannelId: undefined,
|
||||
@@ -963,6 +964,15 @@ exit 1`);
|
||||
|
||||
private verifyTurn(): void {
|
||||
this.guestExec([guestNode, guestOpenClawEntry, "models", "set", this.auth.modelId]);
|
||||
this.guestExec([
|
||||
guestNode,
|
||||
guestOpenClawEntry,
|
||||
"config",
|
||||
"set",
|
||||
`models.providers.${this.options.provider}.timeoutSeconds`,
|
||||
String(agentModelTimeoutSeconds),
|
||||
"--strict-json",
|
||||
]);
|
||||
this.guestExec([
|
||||
guestNode,
|
||||
guestOpenClawEntry,
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { posixAgentWorkspaceScript, windowsAgentWorkspaceScript } from "./agent-workspace.ts";
|
||||
import { shellQuote } from "./host-command.ts";
|
||||
import { psSingleQuote, windowsOpenClawResolver } from "./powershell.ts";
|
||||
import type { ProviderAuth } from "./types.ts";
|
||||
import type { Provider, ProviderAuth } from "./types.ts";
|
||||
|
||||
export interface NpmUpdateScriptInput {
|
||||
auth: ProviderAuth;
|
||||
expectedNeedle: string;
|
||||
provider: Provider;
|
||||
updateTarget: string;
|
||||
}
|
||||
|
||||
const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300);
|
||||
|
||||
export function macosUpdateScript(input: NpmUpdateScriptInput): string {
|
||||
return String.raw`set -euo pipefail
|
||||
export PATH=/opt/homebrew/bin:/opt/homebrew/opt/node/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin
|
||||
@@ -70,6 +73,7 @@ ${posixVersionCheck("/opt/homebrew/bin/openclaw", input.expectedNeedle)}
|
||||
start_openclaw_gateway
|
||||
wait_for_gateway
|
||||
/opt/homebrew/bin/openclaw models set ${shellQuote(input.auth.modelId)}
|
||||
/opt/homebrew/bin/openclaw config set models.providers.${input.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json
|
||||
/opt/homebrew/bin/openclaw config set agents.defaults.skipBootstrap true --strict-json
|
||||
${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.")}
|
||||
${input.auth.apiKeyEnv}=${shellQuote(input.auth.apiKeyValue)} /opt/homebrew/bin/openclaw agent --local --agent main --session-id parallels-npm-update-macos --message 'Reply with exact ASCII text OK only.' --json`;
|
||||
@@ -140,6 +144,7 @@ if ($LASTEXITCODE -ne 0) {
|
||||
}
|
||||
Wait-OpenClawGateway
|
||||
Invoke-OpenClaw models set ${psSingleQuote(input.auth.modelId)}
|
||||
Invoke-OpenClaw config set models.providers.${input.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json
|
||||
Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json
|
||||
${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.")}
|
||||
Set-Item -Path ('Env:' + ${psSingleQuote(input.auth.apiKeyEnv)}) -Value ${psSingleQuote(input.auth.apiKeyValue)}
|
||||
@@ -202,6 +207,7 @@ ${posixVersionCheck("openclaw", input.expectedNeedle)}
|
||||
start_openclaw_gateway
|
||||
wait_for_gateway
|
||||
openclaw models set ${shellQuote(input.auth.modelId)}
|
||||
openclaw config set models.providers.${input.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json
|
||||
openclaw config set agents.defaults.skipBootstrap true --strict-json
|
||||
${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.")}
|
||||
${input.auth.apiKeyEnv}=${shellQuote(input.auth.apiKeyValue)} openclaw agent --local --agent main --session-id parallels-npm-update-linux --message 'Reply with exact ASCII text OK only.' --json`;
|
||||
|
||||
@@ -378,6 +378,7 @@ class NpmUpdateSmoke {
|
||||
const input = {
|
||||
auth: this.auth,
|
||||
expectedNeedle: this.updateExpectedNeedle,
|
||||
provider: this.options.provider,
|
||||
updateTarget: this.updateTargetEffective,
|
||||
};
|
||||
switch (platform) {
|
||||
|
||||
@@ -102,6 +102,8 @@ const defaultOptions = (): WindowsOptions => ({
|
||||
vmName: "Windows 11",
|
||||
});
|
||||
|
||||
const agentModelTimeoutSeconds = Number(process.env.OPENCLAW_PARALLELS_MODEL_TIMEOUT_S || 300);
|
||||
|
||||
function usage(): string {
|
||||
return `Usage: bash scripts/e2e/parallels-windows-smoke.sh [options]
|
||||
|
||||
@@ -879,6 +881,8 @@ if ($LASTEXITCODE -ne 0) { throw "gateway ${action} failed with exit code $LASTE
|
||||
$PSNativeCommandUseErrorActionPreference = $false
|
||||
Invoke-OpenClaw models set ${psSingleQuote(this.auth.modelId)}
|
||||
if ($LASTEXITCODE -ne 0) { throw "models set failed" }
|
||||
Invoke-OpenClaw config set models.providers.${this.options.provider}.timeoutSeconds ${agentModelTimeoutSeconds} --strict-json
|
||||
if ($LASTEXITCODE -ne 0) { throw "provider timeout config set failed" }
|
||||
Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json
|
||||
if ($LASTEXITCODE -ne 0) { throw "config set failed" }
|
||||
${windowsAgentWorkspaceScript("Parallels Windows smoke test assistant.")}
|
||||
|
||||
@@ -283,11 +283,15 @@ console.log(resolveUbuntuVmName("Ubuntu missing"));
|
||||
expect(script, scriptPath).toContain("AgentWorkspaceScript");
|
||||
expect(script, scriptPath).toContain("parallels-");
|
||||
expect(script, scriptPath).toContain("agents.defaults.skipBootstrap");
|
||||
expect(script, scriptPath).toContain("OPENCLAW_PARALLELS_MODEL_TIMEOUT_S");
|
||||
expect(script, scriptPath).toContain("timeoutSeconds");
|
||||
}
|
||||
|
||||
const npmUpdateScripts = readFileSync(TS_PATHS.npmUpdateScripts, "utf8");
|
||||
expect(npmUpdateScripts).toContain("posixAgentWorkspaceScript");
|
||||
expect(npmUpdateScripts).toContain("windowsAgentWorkspaceScript");
|
||||
expect(npmUpdateScripts).toContain("OPENCLAW_PARALLELS_MODEL_TIMEOUT_S");
|
||||
expect(npmUpdateScripts).toContain("timeoutSeconds");
|
||||
});
|
||||
|
||||
it("clears phase timers and applies phase deadlines to guest commands", () => {
|
||||
|
||||
Reference in New Issue
Block a user