test(plugins): add gateway gauntlet · openclaw/openclaw@a6dfaae
vincentkoc
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -206,6 +206,27 @@ describe("qa cli runtime", () => {
|
206 | 206 | }); |
207 | 207 | }); |
208 | 208 | |
| 209 | +it("passes explicit suite plugin enablements into the host gateway run", async () => { |
| 210 | +await runQaSuiteCommand({ |
| 211 | +repoRoot: "/tmp/openclaw-repo", |
| 212 | +providerMode: "mock-openai", |
| 213 | +scenarioIds: ["channel-chat-baseline"], |
| 214 | +enabledPluginIds: ["browser", "memory-core"], |
| 215 | +}); |
| 216 | + |
| 217 | +expect(runQaSuiteFromRuntime).toHaveBeenCalledWith({ |
| 218 | +repoRoot: path.resolve("/tmp/openclaw-repo"), |
| 219 | +outputDir: undefined, |
| 220 | +transportId: "qa-channel", |
| 221 | +providerMode: "mock-openai", |
| 222 | +primaryModel: undefined, |
| 223 | +alternateModel: undefined, |
| 224 | +fastMode: undefined, |
| 225 | +scenarioIds: ["channel-chat-baseline"], |
| 226 | +enabledPluginIds: ["browser", "memory-core"], |
| 227 | +}); |
| 228 | +}); |
| 229 | + |
209 | 230 | it("drops blank suite model refs so provider defaults apply", async () => { |
210 | 231 | await runQaSuiteCommand({ |
211 | 232 | repoRoot: "/tmp/openclaw-repo", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -474,6 +474,7 @@ export async function runQaSuiteCommand(opts: {
|
474 | 474 | scenarioIds?: string[]; |
475 | 475 | concurrency?: number; |
476 | 476 | allowFailures?: boolean; |
| 477 | +enabledPluginIds?: string[]; |
477 | 478 | image?: string; |
478 | 479 | cpus?: number; |
479 | 480 | memory?: string; |
@@ -567,6 +568,7 @@ export async function runQaSuiteCommand(opts: {
|
567 | 568 | ...(thinkingDefault ? { thinkingDefault } : {}), |
568 | 569 | ...(claudeCliAuthMode ? { claudeCliAuthMode } : {}), |
569 | 570 | scenarioIds, |
| 571 | + ...(opts.enabledPluginIds !== undefined ? { enabledPluginIds: opts.enabledPluginIds } : {}), |
570 | 572 | ...(opts.concurrency !== undefined |
571 | 573 | ? { concurrency: parseQaPositiveIntegerOption("--concurrency", opts.concurrency) } |
572 | 574 | : {}), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -37,6 +37,7 @@ async function runQaSuite(opts: {
|
37 | 37 | fastMode?: boolean; |
38 | 38 | thinking?: string; |
39 | 39 | allowFailures?: boolean; |
| 40 | +enabledPluginIds?: string[]; |
40 | 41 | cliAuthMode?: string; |
41 | 42 | parityPack?: string; |
42 | 43 | scenarioIds?: string[]; |
@@ -248,6 +249,12 @@ export function registerQaLabCli(program: Command) {
|
248 | 249 | ) |
249 | 250 | .option("--parity-pack <name>", 'Preset scenario pack; currently only "agentic" is supported') |
250 | 251 | .option("--scenario <id>", "Run only the named QA scenario (repeatable)", collectString, []) |
| 252 | +.option( |
| 253 | +"--enable-plugin <id>", |
| 254 | +"Enable an extra bundled plugin in the QA gateway config (repeatable)", |
| 255 | +collectString, |
| 256 | +[], |
| 257 | +) |
251 | 258 | .option("--concurrency <count>", "Scenario worker concurrency", (value: string) => |
252 | 259 | Number(value), |
253 | 260 | ) |
@@ -278,6 +285,7 @@ export function registerQaLabCli(program: Command) {
|
278 | 285 | cliAuthMode?: string; |
279 | 286 | parityPack?: string; |
280 | 287 | scenario?: string[]; |
| 288 | +enablePlugin?: string[]; |
281 | 289 | concurrency?: number; |
282 | 290 | allowFailures?: boolean; |
283 | 291 | fast?: boolean; |
@@ -301,6 +309,7 @@ export function registerQaLabCli(program: Command) {
|
301 | 309 | cliAuthMode: opts.cliAuthMode, |
302 | 310 | parityPack: opts.parityPack, |
303 | 311 | scenarioIds: opts.scenario, |
| 312 | +enabledPluginIds: opts.enablePlugin, |
304 | 313 | concurrency: opts.concurrency, |
305 | 314 | allowFailures: opts.allowFailures, |
306 | 315 | image: opts.image, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -83,6 +83,7 @@ export type QaSuiteRunParams = {
|
83 | 83 | lab?: QaLabServerHandle; |
84 | 84 | startLab?: QaSuiteStartLabFn; |
85 | 85 | concurrency?: number; |
| 86 | +enabledPluginIds?: string[]; |
86 | 87 | controlUiEnabled?: boolean; |
87 | 88 | transportReadyTimeoutMs?: number; |
88 | 89 | }; |
@@ -433,7 +434,12 @@ export async function runQaSuite(params?: QaSuiteRunParams): Promise<QaSuiteResu
|
433 | 434 | primaryModel, |
434 | 435 | claudeCliAuthMode: params?.claudeCliAuthMode, |
435 | 436 | }); |
436 | | -const enabledPluginIds = collectQaSuitePluginIds(selectedCatalogScenarios); |
| 437 | +const enabledPluginIds = [ |
| 438 | + ...new Set([ |
| 439 | + ...collectQaSuitePluginIds(selectedCatalogScenarios), |
| 440 | + ...(params?.enabledPluginIds ?? []).map((pluginId) => pluginId.trim()).filter(Boolean), |
| 441 | +]), |
| 442 | +]; |
437 | 443 | const gatewayConfigPatch = collectQaSuiteGatewayConfigPatch(selectedCatalogScenarios); |
438 | 444 | const gatewayRuntimeOptions = collectQaSuiteGatewayRuntimeOptions(selectedCatalogScenarios); |
439 | 445 | const concurrency = normalizeQaSuiteConcurrency( |
@@ -553,6 +559,7 @@ export async function runQaSuite(params?: QaSuiteRunParams): Promise<QaSuiteResu
|
553 | 559 | thinkingDefault: params?.thinkingDefault, |
554 | 560 | claudeCliAuthMode: params?.claudeCliAuthMode, |
555 | 561 | scenarioIds: [scenario.id], |
| 562 | +enabledPluginIds: params?.enabledPluginIds, |
556 | 563 | concurrency: 1, |
557 | 564 | startLab, |
558 | 565 | // Most isolated workers do not need their own Control UI proxy. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1544,6 +1544,7 @@
|
1544 | 1544 | "test:perf:imports:changed": "OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1 node scripts/test-projects.mjs --changed origin/main", |
1545 | 1545 | "test:perf:profile:main": "node scripts/run-vitest-profile.mjs main", |
1546 | 1546 | "test:perf:profile:runner": "node scripts/run-vitest-profile.mjs runner", |
| 1547 | +"test:plugins:gateway-gauntlet": "node scripts/check-plugin-gateway-gauntlet.mjs", |
1547 | 1548 | "test:sectriage": "OPENCLAW_GATEWAY_PROJECT_SHARDS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts && node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts --exclude src/daemon/launchd.integration.test.ts --exclude src/process/exec.test.ts", |
1548 | 1549 | "test:serial": "OPENCLAW_TEST_PROJECTS_SERIAL=1 OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/test-projects.mjs", |
1549 | 1550 | "test:stability:gateway": "OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/gateway-stability.test.ts && OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.logging.config.ts src/logging/diagnostic-stability-bundle.test.ts && OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/fatal-error-hooks.test.ts", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -163,7 +163,7 @@ function collectObservations(params) {
|
163 | 163 | const observations = []; |
164 | 164 | for (const result of params.startup?.results ?? []) { |
165 | 165 | const cpuCoreMax = result.summary?.cpuCoreRatio?.max; |
166 | | -const wallMax = result.summary?.readyz?.max ?? result.summary?.healthz?.max; |
| 166 | +const wallMax = result.summary?.readyzMs?.max ?? result.summary?.healthzMs?.max; |
167 | 167 | if ( |
168 | 168 | typeof cpuCoreMax === "number" && |
169 | 169 | typeof wallMax === "number" && |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。