mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 11:25:50 -06:00
fix(qa): preserve scenario isolation in serial suites (#119439)
This commit is contained in:
committed by
GitHub
parent
e35d22807e
commit
b5237ac86a
@@ -749,6 +749,45 @@ describe("qa suite planning helpers", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
reason: "explicit scenario isolation",
|
||||
makeScenario: () => makeQaSuiteTestScenario("isolated", { suiteIsolation: "isolated" }),
|
||||
},
|
||||
{
|
||||
reason: "gateway runtime changes",
|
||||
makeScenario: () =>
|
||||
makeQaSuiteTestScenario("runtime-options", { gatewayRuntime: { forwardHostHome: true } }),
|
||||
},
|
||||
{
|
||||
reason: "scenario-owned plugins",
|
||||
makeScenario: () => makeQaSuiteTestScenario("plugin", { plugins: ["diagnostics-otel"] }),
|
||||
},
|
||||
{
|
||||
reason: "memory state",
|
||||
makeScenario: () => makeQaSuiteTestScenario("memory", { surface: "memory" }),
|
||||
},
|
||||
{
|
||||
reason: "image generation setup",
|
||||
makeScenario: () =>
|
||||
makeQaSuiteTestScenario("image-generation", { config: { ensureImageGeneration: true } }),
|
||||
},
|
||||
{
|
||||
reason: "state-mutating flow calls",
|
||||
makeScenario: () => readQaScenarioById("plugin-lifecycle-hot-reload"),
|
||||
},
|
||||
])("isolates serial runs for $reason", ({ makeScenario }) => {
|
||||
const scenario = makeScenario();
|
||||
|
||||
expect(scenarioRequiresIsolatedQaSuiteWorker(scenario)).toBe(true);
|
||||
expect(
|
||||
shouldUseIsolatedQaSuiteScenarioWorkers({
|
||||
scenarios: [makeQaSuiteTestScenario("baseline"), scenario],
|
||||
concurrency: 1,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("does not isolate plain serial scenario runs", () => {
|
||||
expect(
|
||||
shouldUseIsolatedQaSuiteScenarioWorkers({
|
||||
|
||||
@@ -288,10 +288,8 @@ function shouldUseIsolatedQaSuiteScenarioWorkers(params: {
|
||||
(params.concurrency > 1 ||
|
||||
params.scenarios.some(
|
||||
(scenario) =>
|
||||
isQaMergePatchObject(scenario.gatewayConfigPatch) ||
|
||||
(scenario.execution.kind === "flow" && scenario.execution.providerMode !== undefined) ||
|
||||
(scenario.execution.kind === "flow" && scenario.execution.runtime !== undefined) ||
|
||||
(scenario.execution.kind === "flow" && scenario.execution.transportPolicy !== undefined),
|
||||
scenarioRequiresIsolatedQaSuiteWorker(scenario) ||
|
||||
(scenario.execution.kind === "flow" && scenario.execution.providerMode !== undefined),
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user