From 9a051d2f9b3b8dcb8804dec2343033b4e8661462 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 11:03:13 +0100 Subject: [PATCH] test: preseed dev channel in Parallels update --- scripts/e2e/parallels/macos-smoke.ts | 8 ++++++++ scripts/e2e/parallels/npm-update-scripts.ts | 2 +- scripts/e2e/parallels/windows-smoke.ts | 9 ++++++++- test/scripts/parallels-smoke-model.test.ts | 8 ++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/scripts/e2e/parallels/macos-smoke.ts b/scripts/e2e/parallels/macos-smoke.ts index 0794bab3e39..c0b5debcd14 100755 --- a/scripts/e2e/parallels/macos-smoke.ts +++ b/scripts/e2e/parallels/macos-smoke.ts @@ -854,6 +854,14 @@ mkdir -p "$bootstrap_root" `set -eu rm -rf ${shellQuote(`${home}/openclaw`)} export PATH=${shellQuote(`/tmp/openclaw-smoke-pnpm-bootstrap/node_modules/.bin:${guestPath}`)} +${guestNode} - <<'JS' +const fs = require("node:fs"); +const path = require("node:path"); +const configPath = path.join(process.env.HOME || ${JSON.stringify(home)}, ".openclaw", "openclaw.json"); +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 ${guestNode} ${guestOpenClawEntry} --version ${guestNode} ${guestOpenClawEntry} update status --json`, diff --git a/scripts/e2e/parallels/npm-update-scripts.ts b/scripts/e2e/parallels/npm-update-scripts.ts index b08aee25bc0..fda3b868877 100644 --- a/scripts/e2e/parallels/npm-update-scripts.ts +++ b/scripts/e2e/parallels/npm-update-scripts.ts @@ -143,7 +143,7 @@ Wait-OpenClawGateway Invoke-OpenClaw models set ${psSingleQuote(input.auth.modelId)} Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json Invoke-OpenClaw config set tools.profile minimal -Invoke-OpenClaw config set models.providers.openai '{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}' --strict-json +Invoke-OpenClaw config set models.providers.openai ${psSingleQuote('{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}')} --strict-json ${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.")} Set-Item -Path ('Env:' + ${psSingleQuote(input.auth.apiKeyEnv)}) -Value ${psSingleQuote(input.auth.apiKeyValue)} Invoke-OpenClaw agent --local --agent main --session-id parallels-npm-update-windows --message 'Reply with exact ASCII text OK only.' --thinking minimal --json`; diff --git a/scripts/e2e/parallels/windows-smoke.ts b/scripts/e2e/parallels/windows-smoke.ts index 19f8d3c1cee..0045ce8787e 100755 --- a/scripts/e2e/parallels/windows-smoke.ts +++ b/scripts/e2e/parallels/windows-smoke.ts @@ -798,6 +798,13 @@ if ((Test-Path $logPath) -or (Test-Path $donePath)) { $portableGit = Join-Path (Join-Path (Join-Path $env:LOCALAPPDATA 'OpenClaw\\deps') 'portable-git') '' $env:PATH = "$portableGit\\cmd;$portableGit\\mingw64\\bin;$portableGit\\usr\\bin;$env:PATH" where.exe git.exe +$configPath = Join-Path $env:USERPROFILE '.openclaw\\openclaw.json' +$config = Get-Content $configPath -Raw | ConvertFrom-Json +if ($null -eq $config.update) { + $config | Add-Member -MemberType NoteProperty -Name update -Value ([pscustomobject]@{}) +} +$config.update | Add-Member -Force -MemberType NoteProperty -Name channel -Value 'dev' +$config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding utf8 $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" } @@ -883,7 +890,7 @@ Invoke-OpenClaw config set agents.defaults.skipBootstrap true --strict-json if ($LASTEXITCODE -ne 0) { throw "config set failed" } Invoke-OpenClaw config set tools.profile minimal if ($LASTEXITCODE -ne 0) { throw "tools profile config set failed" } -Invoke-OpenClaw config set models.providers.openai '{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}' --strict-json +Invoke-OpenClaw config set models.providers.openai ${psSingleQuote('{"baseUrl":"https://api.openai.com/v1","models":[],"timeoutSeconds":300}')} --strict-json if ($LASTEXITCODE -ne 0) { throw "openai provider timeout config set failed" } ${windowsAgentWorkspaceScript("Parallels Windows smoke test assistant.")} Set-Item -Path ('Env:' + ${psSingleQuote(this.auth.apiKeyEnv)}) -Value ${psSingleQuote(this.auth.apiKeyValue)} diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index dd8a85d3be7..e95696615aa 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -332,6 +332,14 @@ console.log(resolveUbuntuVmName("Ubuntu missing")); expect(combined).toContain("where.exe git.exe"); }); + it("preseeds dev update channel before stable-to-dev update lanes", () => { + const macos = readFileSync(TS_PATHS.macos, "utf8"); + const windows = readFileSync(TS_PATHS.windows, "utf8"); + + expect(macos).toContain('channel: "dev"'); + expect(windows).toContain("Name channel -Value 'dev'"); + }); + it("passes aggregate model overrides into each OS fresh lane", () => { const script = readFileSync(TS_PATHS.npmUpdate, "utf8");