Skip to content

Commit 972435f

Browse files
committed
feat(qa): forward shared suite flags to multipass runner
1 parent a3c786e commit 972435f

4 files changed

Lines changed: 90 additions & 13 deletions

File tree

‎extensions/qa-lab/src/cli.runtime.test.ts‎

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -729,18 +729,28 @@ describe("qa cli runtime", () => {
729729
});
730730
});
731731

732-
it("keeps Crabline channel-driver independent from the VM runner", async () => {
733-
await expect(
734-
runQaSuiteCommand({
735-
repoRoot: "/tmp/openclaw-repo",
736-
providerMode: "mock-openai",
737-
channelDriver: "crabline",
738-
channel: "telegram",
739-
runner: "multipass",
732+
it("passes Crabline channel-driver selection through to the multipass runner", async () => {
733+
await runQaSuiteCommand({
734+
repoRoot: "/tmp/openclaw-repo",
735+
providerMode: "mock-openai",
736+
channelDriver: "crabline",
737+
channel: "telegram",
738+
runner: "multipass",
739+
scenarioIds: ["channel-chat-baseline"],
740+
allowFailures: true,
741+
});
742+
743+
expect(runQaMultipass).toHaveBeenCalledWith(
744+
expect.objectContaining({
745+
channelDriverSelection: {
746+
capabilityMatrixPath: "crabline-channel-capability-matrix.json",
747+
channel: "telegram",
748+
channelDriver: "crabline",
749+
smokeArtifactPath: "crabline-channel-smoke.json",
750+
},
740751
}),
741-
).rejects.toThrow("--channel-driver crabline requires --runner host.");
752+
);
742753
expect(runQaSuite).not.toHaveBeenCalled();
743-
expect(runQaMultipass).not.toHaveBeenCalled();
744754
});
745755

746756
it("passes explicit suite plugin enablements into the host gateway run", async () => {
@@ -1989,6 +1999,24 @@ describe("qa cli runtime", () => {
19891999
);
19902000
});
19912001

2002+
it("passes explicit suite plugin enablements through to the multipass runner", async () => {
2003+
await runQaSuiteCommand({
2004+
repoRoot: "/tmp/openclaw-repo",
2005+
runner: "multipass",
2006+
providerMode: "mock-openai",
2007+
scenarioIds: ["channel-chat-baseline"],
2008+
enabledPluginIds: ["browser", "memory-core"],
2009+
allowFailures: true,
2010+
});
2011+
2012+
expect(runQaMultipass).toHaveBeenCalledWith(
2013+
expect.objectContaining({
2014+
enabledPluginIds: ["browser", "memory-core"],
2015+
}),
2016+
);
2017+
expect(runQaSuite).not.toHaveBeenCalled();
2018+
});
2019+
19922020
it("passes live suite selection through to the multipass runner", async () => {
19932021
await runQaSuiteCommand({
19942022
repoRoot: "/tmp/openclaw-repo",

‎extensions/qa-lab/src/cli.runtime.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,9 +1164,6 @@ export async function runQaSuiteCommand(opts: QaSuiteCommandOptions) {
11641164
if (opts.preflight === true && runner !== "host") {
11651165
throw new Error("--preflight requires --runner host.");
11661166
}
1167-
if (channelDriver === "crabline" && runner !== "host") {
1168-
throw new Error("--channel-driver crabline requires --runner host.");
1169-
}
11701167
const selectedScenarioChannel =
11711168
channelDriver === "crabline"
11721169
? resolveQaSuiteScenarioChannel({
@@ -1217,6 +1214,8 @@ export async function runQaSuiteCommand(opts: QaSuiteCommandOptions) {
12171214
? { concurrency: parseQaPositiveIntegerOption("--concurrency", opts.concurrency) }
12181215
: {}),
12191216
...(runtimePair ? { runtimePair } : {}),
1217+
...(channelDriverSelection ? { channelDriverSelection } : {}),
1218+
...(opts.enabledPluginIds !== undefined ? { enabledPluginIds: opts.enabledPluginIds } : {}),
12201219
image: opts.image,
12211220
cpus: parseQaPositiveIntegerOption("--cpus", opts.cpus),
12221221
memory: opts.memory,

‎extensions/qa-lab/src/multipass.runtime.test.ts‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,37 @@ describe("qa multipass runtime", () => {
158158
expect(plan.qaCommand).toEqual(expect.arrayContaining(["--runtime-pair", "openclaw,codex"]));
159159
});
160160

161+
it("forwards channel-driver suite selection into the guest qa suite command", () => {
162+
const plan = createQaMultipassPlan({
163+
repoRoot: process.cwd(),
164+
outputDir: path.join(process.cwd(), ".artifacts", "qa-e2e", "crabline-channel-driver-test"),
165+
channelDriverSelection: {
166+
capabilityMatrixPath: "crabline-channel-capability-matrix.json",
167+
channel: "telegram",
168+
channelDriver: "crabline",
169+
smokeArtifactPath: "crabline-channel-smoke.json",
170+
},
171+
scenarioIds: ["channel-chat-baseline"],
172+
});
173+
174+
expect(plan.qaCommand).toEqual(
175+
expect.arrayContaining(["--channel-driver", "crabline", "--channel", "telegram"]),
176+
);
177+
});
178+
179+
it("forwards suite plugin enablements into the guest qa suite command", () => {
180+
const plan = createQaMultipassPlan({
181+
repoRoot: process.cwd(),
182+
outputDir: path.join(process.cwd(), ".artifacts", "qa-e2e", "multipass-enable-plugin-test"),
183+
enabledPluginIds: ["browser", "memory-core", "browser"],
184+
scenarioIds: ["channel-chat-baseline"],
185+
});
186+
187+
expect(plan.qaCommand).toEqual(
188+
expect.arrayContaining(["--enable-plugin", "browser", "--enable-plugin", "memory-core"]),
189+
);
190+
});
191+
161192
it("redacts forwarded live secrets in the persisted artifact script", () => {
162193
vi.stubEnv("OPENAI_API_KEY", "test-openai-key");
163194
const plan = createQaMultipassPlan({

‎extensions/qa-lab/src/multipass.runtime.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { sleep } from "openclaw/plugin-sdk/runtime-env";
88
import { appendRegularFile } from "openclaw/plugin-sdk/security-runtime";
99
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
1010
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
11+
import type { QaCrablineChannelDriverSelection } from "./crabline-channel-driver.js";
1112
import type { QaProviderMode } from "./model-selection.js";
1213
import { resolveQaForwardedLiveEnv, resolveQaLiveProviderConfigPath } from "./providers/env.js";
1314
import { DEFAULT_QA_LIVE_PROVIDER_MODE, getQaProvider } from "./providers/index.js";
@@ -79,6 +80,8 @@ type QaMultipassPlan = {
7980
fastMode?: boolean;
8081
thinkingDefault?: string;
8182
runtimePair?: [RuntimeId, RuntimeId];
83+
channelDriverSelection?: QaCrablineChannelDriverSelection;
84+
enabledPluginIds?: string[];
8285
scenarioIds: string[];
8386
forwardedEnv: Record<string, string>;
8487
hostCodexHomePath?: string;
@@ -242,13 +245,18 @@ export function createQaMultipassPlan(params: {
242245
scenarioIds?: string[];
243246
concurrency?: number;
244247
runtimePair?: [RuntimeId, RuntimeId];
248+
channelDriverSelection?: QaCrablineChannelDriverSelection;
249+
enabledPluginIds?: string[];
245250
image?: string;
246251
cpus?: number;
247252
memory?: string;
248253
disk?: string;
249254
}) {
250255
const outputDir = params.outputDir ?? createQaMultipassOutputDir(params.repoRoot);
251256
const scenarioIds = uniqueStrings(params.scenarioIds ?? []);
257+
const enabledPluginIds = uniqueStrings(
258+
(params.enabledPluginIds ?? []).map((pluginId) => pluginId.trim()).filter(Boolean),
259+
);
252260
const transportId = params.transportId?.trim() || "qa-channel";
253261
const providerMode = params.providerMode ?? DEFAULT_QA_LIVE_PROVIDER_MODE;
254262
const provider = getQaProvider(providerMode);
@@ -282,6 +290,15 @@ export function createQaMultipassPlan(params: {
282290
...(params.allowFailures ? ["--allow-failures"] : []),
283291
...(params.concurrency ? ["--concurrency", String(params.concurrency)] : []),
284292
...(params.runtimePair ? ["--runtime-pair", params.runtimePair.join(",")] : []),
293+
...(params.channelDriverSelection
294+
? [
295+
"--channel-driver",
296+
params.channelDriverSelection.channelDriver,
297+
"--channel",
298+
params.channelDriverSelection.channel,
299+
]
300+
: []),
301+
...enabledPluginIds.flatMap((pluginId) => ["--enable-plugin", pluginId]),
285302
],
286303
scenarioIds,
287304
);
@@ -307,6 +324,8 @@ export function createQaMultipassPlan(params: {
307324
fastMode: params.fastMode,
308325
thinkingDefault: params.thinkingDefault,
309326
runtimePair: params.runtimePair,
327+
channelDriverSelection: params.channelDriverSelection,
328+
enabledPluginIds,
310329
scenarioIds,
311330
forwardedEnv,
312331
hostCodexHomePath,

0 commit comments

Comments
 (0)