test: stabilize Parallels update smokes

This commit is contained in:
Peter Steinberger
2026-05-01 12:05:22 +01:00
parent 1e3d240220
commit 1c9b4d871c
6 changed files with 73 additions and 10 deletions

View File

@@ -862,7 +862,7 @@ const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
config.update = { ...(config.update || {}), channel: "dev" };
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\\n");
JS
/usr/bin/env NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 ${guestNode} ${guestOpenClawEntry} update --channel dev --yes --json
/usr/bin/env NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1 OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 ${guestNode} ${guestOpenClawEntry} update --channel dev --yes --json
${guestNode} ${guestOpenClawEntry} --version
${guestNode} ${guestOpenClawEntry} update status --json`,
);

View File

@@ -65,7 +65,7 @@ wait_for_gateway() {
}
scrub_future_plugin_entries
stop_openclaw_gateway_processes
OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 /opt/homebrew/bin/openclaw update --tag ${shellQuote(input.updateTarget)} --yes --json --no-restart
OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1 OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 /opt/homebrew/bin/openclaw update --tag ${shellQuote(input.updateTarget)} --yes --json --no-restart
${posixVersionCheck("/opt/homebrew/bin/openclaw", input.expectedNeedle)}
start_openclaw_gateway
wait_for_gateway
@@ -111,6 +111,7 @@ function Stop-OpenClawGatewayProcesses {
Remove-FuturePluginEntries
Stop-OpenClawGatewayProcesses
$env:OPENCLAW_DISABLE_BUNDLED_PLUGINS = '1'
$env:OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS = '1'
$updateOutput = Invoke-OpenClaw update --tag ${psSingleQuote(input.updateTarget)} --yes --json --no-restart 2>&1
$updateExit = $LASTEXITCODE
$updateOutput
@@ -215,7 +216,7 @@ wait_for_gateway() {
}
scrub_future_plugin_entries
stop_openclaw_gateway_processes
OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 openclaw update --tag ${shellQuote(input.updateTarget)} --yes --json --no-restart
OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1 OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 openclaw update --tag ${shellQuote(input.updateTarget)} --yes --json --no-restart
${posixVersionCheck("openclaw", input.expectedNeedle)}
start_openclaw_gateway
wait_for_gateway

View File

@@ -13,6 +13,7 @@ import {
resolveHostIp,
resolveLatestVersion,
resolveProviderAuth,
resolveWindowsProviderAuth,
run,
say,
startHostServer,
@@ -145,6 +146,7 @@ function platformRecord<T>(value: T): Record<Platform, T> {
class NpmUpdateSmoke {
private auth: ProviderAuth;
private windowsAuth: ProviderAuth;
private runDir = "";
private tgzDir = "";
private latestVersion = "";
@@ -168,6 +170,11 @@ class NpmUpdateSmoke {
modelId: options.modelId,
provider: options.provider,
});
this.windowsAuth = resolveWindowsProviderAuth({
apiKeyEnv: options.apiKeyEnv,
modelId: options.modelId,
provider: options.provider,
});
}
async run(): Promise<void> {
@@ -243,6 +250,7 @@ class NpmUpdateSmoke {
env: NodeJS.ProcessEnv = {},
): Job {
const logPath = path.join(this.runDir, `${platform}-fresh.log`);
const auth = this.authForPlatform(platform);
const args = [
"exec",
"tsx",
@@ -252,9 +260,9 @@ class NpmUpdateSmoke {
"--provider",
this.options.provider,
"--model",
this.auth.modelId,
auth.modelId,
"--api-key-env",
this.auth.apiKeyEnv,
auth.apiKeyEnv,
"--target-package-spec",
this.packageSpec,
"--json",
@@ -376,7 +384,7 @@ class NpmUpdateSmoke {
private updateScript(platform: Platform): string {
const input = {
auth: this.auth,
auth: this.authForPlatform(platform),
expectedNeedle: this.updateExpectedNeedle,
updateTarget: this.updateTargetEffective,
};
@@ -391,6 +399,10 @@ class NpmUpdateSmoke {
return die("unsupported platform");
}
private authForPlatform(platform: Platform): ProviderAuth {
return platform === "windows" ? this.windowsAuth : this.auth;
}
private spawnLogged(
command: string,
args: string[],

View File

@@ -53,6 +53,25 @@ export function resolveProviderAuth(input: {
return { ...resolved, apiKeyValue };
}
export function resolveWindowsProviderAuth(input: {
provider: Provider;
apiKeyEnv?: string;
modelId?: string;
}): ProviderAuth {
const auth = resolveProviderAuth(input);
if (input.provider !== "openai" || input.modelId) {
return auth;
}
const windowsModel = process.env.OPENCLAW_PARALLELS_WINDOWS_OPENAI_MODEL?.trim();
if (windowsModel) {
return { ...auth, modelId: windowsModel };
}
if (process.env.OPENCLAW_PARALLELS_OPENAI_MODEL?.trim()) {
return auth;
}
return { ...auth, modelId: "openai/gpt-4.1-mini" };
}
export function parseProvider(value: string): Provider {
if (value === "openai" || value === "anthropic" || value === "minimax") {
return value;

View File

@@ -14,7 +14,7 @@ import {
resolveHostIp,
resolveHostPort,
resolveLatestVersion,
resolveProviderAuth,
resolveWindowsProviderAuth,
resolveSnapshot,
run,
runStreaming,
@@ -241,7 +241,7 @@ class WindowsSmoke {
};
constructor(private options: WindowsOptions) {
this.auth = resolveProviderAuth({
this.auth = resolveWindowsProviderAuth({
apiKeyEnv: options.apiKeyEnv,
modelId: options.modelId,
provider: options.provider,
@@ -805,6 +805,7 @@ if ($null -eq $config.update) {
}
$config.update | Add-Member -Force -MemberType NoteProperty -Name channel -Value 'dev'
$config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding utf8
$env:OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS = '1'
$env:OPENCLAW_DISABLE_BUNDLED_PLUGINS = '1'
Invoke-OpenClaw update --channel dev --yes --json
if ($LASTEXITCODE -ne 0) { throw "openclaw update failed with exit code $LASTEXITCODE" }