mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-06 13:36:53 +00:00
refactor(qa-lab): merge scenario gateway env like config patches
This commit is contained in:
parent
dbc5955cd7
commit
c8a2682be6
2 changed files with 1 additions and 23 deletions
|
|
@ -432,23 +432,6 @@ describe("qa suite planning helpers", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("merges scenario QA gateway env and rejects conflicting values", () => {
|
||||
const stuck = makeQaSuiteTestScenario("stuck", {
|
||||
gatewayRuntime: { env: { QA_DIAGNOSTIC_STUCK_SESSION_ABORT_MS: "30000" } },
|
||||
});
|
||||
expect(collectQaSuiteGatewayRuntimeOptions([makeQaSuiteTestScenario("plain"), stuck])).toEqual({
|
||||
env: { QA_DIAGNOSTIC_STUCK_SESSION_ABORT_MS: "30000" },
|
||||
});
|
||||
expect(() =>
|
||||
collectQaSuiteGatewayRuntimeOptions([
|
||||
stuck,
|
||||
makeQaSuiteTestScenario("slower", {
|
||||
gatewayRuntime: { env: { QA_DIAGNOSTIC_STUCK_SESSION_ABORT_MS: "60000" } },
|
||||
}),
|
||||
]),
|
||||
).toThrow(/QA_DIAGNOSTIC_STUCK_SESSION_ABORT_MS/);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
reason: "explicit scenario isolation",
|
||||
|
|
|
|||
|
|
@ -262,12 +262,7 @@ function collectQaSuiteGatewayRuntimeOptions(scenarios: QaSeedScenario[]) {
|
|||
allowUnhealthyStartup ||= scenario.gatewayRuntime?.allowUnhealthyStartup === true;
|
||||
forwardHostHome ||= scenario.gatewayRuntime?.forwardHostHome === true;
|
||||
preserveDebugArtifacts ||= scenario.gatewayRuntime?.preserveDebugArtifacts === true;
|
||||
for (const [key, value] of Object.entries(scenario.gatewayRuntime?.env ?? {})) {
|
||||
if (env[key] !== undefined && env[key] !== value) {
|
||||
throw new Error(`conflicting QA gateway runtime env for ${key} in scenario ${scenario.id}`);
|
||||
}
|
||||
env[key] = value;
|
||||
}
|
||||
Object.assign(env, scenario.gatewayRuntime?.env);
|
||||
}
|
||||
const hasEnv = Object.keys(env).length > 0;
|
||||
return allowUnhealthyStartup || forwardHostHome || preserveDebugArtifacts || hasEnv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue