




















@@ -1,4 +1,6 @@
11import { afterEach, describe, expect, it, vi } from "vitest";
2+import type { QaLabServerHandle } from "./lab-server.types.js";
3+import { makeQaSuiteTestScenario } from "./suite-test-helpers.js";
24import { qaSuiteProgressTesting, runQaSuite } from "./suite.js";
3546const fetchWithSsrFGuardMock = vi.hoisted(() => vi.fn());
@@ -12,6 +14,19 @@ afterEach(() => {
1214vi.useRealTimers();
1315});
141617+function makeQaSuiteTestLabHandle(): QaLabServerHandle {
18+return {
19+baseUrl: "http://127.0.0.1:43123",
20+listenUrl: "http://127.0.0.1:43123",
21+state: {} as QaLabServerHandle["state"],
22+setControlUi: vi.fn(),
23+setScenarioRun: vi.fn(),
24+setLatestReport: vi.fn(),
25+runSelfCheck: vi.fn(async () => ({}) as Awaited<ReturnType<QaLabServerHandle["runSelfCheck"]>>),
26+stop: vi.fn(async () => {}),
27+};
28+}
29+1530describe("qa suite", () => {
1631it("rejects unsupported transport ids before starting the lab", async () => {
1732const startLab = vi.fn();
@@ -254,6 +269,84 @@ describe("qa suite", () => {
254269});
255270});
256271272+it("forwards run options into isolated scenario worker params", () => {
273+const startLab = vi.fn();
274+const scenario = makeQaSuiteTestScenario("patched-control-ui", {
275+surface: "control-ui",
276+gatewayConfigPatch: {
277+messages: {
278+groupChat: {
279+visibleReplies: "message_tool",
280+},
281+},
282+},
283+});
284+285+expect(
286+qaSuiteProgressTesting.buildQaIsolatedScenarioWorkerParams({
287+repoRoot: "/repo",
288+outputDir: "/repo/.artifacts/qa-e2e/scenarios/patched-control-ui",
289+providerMode: "mock-openai",
290+transportId: "qa-channel",
291+primaryModel: "mock-openai/gpt-5.5",
292+alternateModel: "mock-openai/gpt-5.5-alt",
293+fastMode: true,
294+ scenario,
295+ startLab,
296+input: {
297+thinkingDefault: "minimal",
298+claudeCliAuthMode: "subscription",
299+enabledPluginIds: ["acpx"],
300+transportReadyTimeoutMs: 180_000,
301+forcedRuntime: "codex",
302+},
303+}),
304+).toMatchObject({
305+scenarioIds: ["patched-control-ui"],
306+concurrency: 1,
307+ startLab,
308+controlUiEnabled: true,
309+thinkingDefault: "minimal",
310+claudeCliAuthMode: "subscription",
311+enabledPluginIds: ["acpx"],
312+transportReadyTimeoutMs: 180_000,
313+forcedRuntime: "codex",
314+});
315+});
316+317+it("keeps caller-owned serial labs on shared workers without a launcher", () => {
318+const scenarios = [
319+makeQaSuiteTestScenario("baseline"),
320+makeQaSuiteTestScenario("message-tool-mode", {
321+gatewayConfigPatch: {
322+messages: {
323+groupChat: {
324+visibleReplies: "message_tool",
325+},
326+},
327+},
328+}),
329+];
330+const lab = makeQaSuiteTestLabHandle();
331+const startLab = vi.fn();
332+333+expect(
334+qaSuiteProgressTesting.shouldRunQaSuiteWithIsolatedScenarioWorkers({
335+ scenarios,
336+concurrency: 1,
337+ lab,
338+}),
339+).toBe(false);
340+expect(
341+qaSuiteProgressTesting.shouldRunQaSuiteWithIsolatedScenarioWorkers({
342+ scenarios,
343+concurrency: 1,
344+ lab,
345+ startLab,
346+}),
347+).toBe(true);
348+});
349+257350it("remaps mock-openai model refs onto the app-server OpenAI provider for codex cells only", () => {
258351expect(
259352qaSuiteProgressTesting.remapModelRefForForcedRuntime({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。