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

@@ -87,7 +87,9 @@ describe("Parallels smoke model selection", () => {
const providerAuth = readFileSync(TS_PATHS.providerAuth, "utf8");
expect(providerAuth).toContain("OPENCLAW_PARALLELS_OPENAI_MODEL");
expect(providerAuth).toContain("OPENCLAW_PARALLELS_WINDOWS_OPENAI_MODEL");
expect(providerAuth).toContain("openai/gpt-5.5");
expect(providerAuth).toContain("openai/gpt-4.1-mini");
expect(providerAuth).toContain('authChoice: "openai-api-key"');
expect(providerAuth).toContain('authChoice: "apiKey"');
expect(providerAuth).toContain('authChoice: "minimax-global-api"');
@@ -95,7 +97,7 @@ describe("Parallels smoke model selection", () => {
for (const scriptPath of [...OS_TS_PATHS, TS_PATHS.npmUpdate]) {
const script = readFileSync(scriptPath, "utf8");
expect(script, scriptPath).toContain("resolveProviderAuth");
expect(script, scriptPath).toMatch(/resolve(?:Windows)?ProviderAuth/u);
expect(script, scriptPath).toContain("--model <provider/model>");
expect(script, scriptPath).toContain("modelId");
}
@@ -243,6 +245,31 @@ console.log(resolveUbuntuVmName("Ubuntu missing"));
});
});
it("uses the faster OpenAI model for Windows smoke unless overridden", () => {
const source = `
import { resolveWindowsProviderAuth } from "./${TS_PATHS.common}";
const result = resolveWindowsProviderAuth({
provider: "openai",
});
console.log(JSON.stringify(result));
`;
expect(JSON.parse(runTsEval(source, { OPENAI_API_KEY: "sk-openai" }))).toMatchObject({
apiKeyEnv: "OPENAI_API_KEY",
modelId: "openai/gpt-4.1-mini",
});
expect(
JSON.parse(
runTsEval(source, {
OPENAI_API_KEY: "sk-openai",
OPENCLAW_PARALLELS_WINDOWS_OPENAI_MODEL: "openai/custom-windows",
}),
),
).toMatchObject({
modelId: "openai/custom-windows",
});
});
it("rejects invalid providers and missing keys before touching guests", () => {
const invalidProvider = spawnSync(
"node",
@@ -338,6 +365,8 @@ console.log(resolveUbuntuVmName("Ubuntu missing"));
expect(macos).toContain('channel: "dev"');
expect(windows).toContain("Name channel -Value 'dev'");
expect(macos).toContain("OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1");
expect(windows).toContain("OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS");
});
it("passes aggregate model overrides into each OS fresh lane", () => {
@@ -345,7 +374,8 @@ console.log(resolveUbuntuVmName("Ubuntu missing"));
expect(script).toContain("scripts/e2e/parallels/${platform}-smoke.ts");
expect(script).toContain('"--model"');
expect(script).toContain("this.auth.modelId");
expect(script).toContain("auth.modelId");
expect(script).toContain("authForPlatform");
expect(script).toContain("OPENCLAW_PARALLELS_LINUX_DISABLE_BONJOUR");
});