Skip to content

Commit e8db9c3

Browse files
authored
test(qa): add qa run --profile and unified output summary/evidence (#91587)
* test(qa): add mapped qa run profiles * test(qa): document mapped profile runner * test(qa): validate run profiles from mapping * test(qa): preserve root profile parsing * test(qa): simplify taxonomy profile dispatch * test(qa): align tool coverage CLI expectation * test(qa): fix profile dispatch fixture type * test(qa): share profile runner option types * test(qa): split shared cli runner options * test(qa): unify profile suite artifacts * fix(qa): filter profile scenarios by provider lane * test(qa): drop native scenario subreports * fix(qa): keep native log refs repo-relative * fix(cli): preserve qa run root profile parsing * fix(qa): avoid qa profile flag collision * fix(qa): reject profile flags without qa profile
1 parent e82d19f commit e8db9c3

13 files changed

Lines changed: 1129 additions & 268 deletions

‎docs/concepts/qa-e2e-automation.md‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ script aliases; both forms are supported.
3131

3232
| Command | Purpose |
3333
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34-
| `qa run` | Bundled QA self-check; writes a Markdown report. |
34+
| `qa run` | Bundled QA self-check without `--qa-profile`; taxonomy-backed maturity profile runner with `--qa-profile smoke-ci` or `--qa-profile release`. |
3535
| `qa suite` | Run repo-backed scenarios against the QA gateway lane. Aliases: `pnpm openclaw qa suite --runner multipass` for a disposable Linux VM. |
3636
| `qa coverage` | Print the YAML scenario-coverage inventory (`--json` for machine output). |
3737
| `qa parity-report` | Compare two `qa-suite-summary.json` files and write the agentic parity report, or use `--runtime-axis --token-efficiency` to write Codex-vs-OpenClaw runtime parity and token-efficiency reports from one runtime-pair summary. |
@@ -51,6 +51,26 @@ script aliases; both forms are supported.
5151
| `qa whatsapp` | Live transport lane against real WhatsApp Web accounts. |
5252
| `qa mantis` | Before and after verification runner for live transport bugs, with Discord status-reactions evidence, Crabbox desktop/browser smoke, and Slack-in-VNC smoke. See [Mantis](/concepts/mantis) and [Mantis Slack Desktop Runbook](/concepts/mantis-slack-desktop-runbook). |
5353

54+
Profile-backed `qa run` reads membership from `taxonomy.yaml`, then dispatches
55+
the resolved scenarios through `qa suite`. `--surface` and
56+
`--category` filter the selected profile instead of defining separate lanes:
57+
58+
```bash
59+
pnpm openclaw qa run \
60+
--qa-profile smoke-ci \
61+
--category agent-runtime-and-provider-execution.agent-turn-execution \
62+
--provider-mode mock-openai \
63+
--output-dir .artifacts/qa-e2e/smoke-ci-profile-dispatch
64+
```
65+
66+
Use `smoke-ci` for deterministic no-live-service proof and `release` for the
67+
Stable/LTS proof lane. When a command also needs an OpenClaw root profile, put
68+
the root profile before the QA command:
69+
70+
```bash
71+
pnpm openclaw --profile work qa run --qa-profile smoke-ci
72+
```
73+
5474
## Operator flow
5575

5676
The current QA operator flow is a two-pane QA site:
@@ -913,7 +933,11 @@ The report should answer:
913933
For the inventory of available scenarios - useful when sizing follow-up work or wiring a new transport - run `pnpm openclaw qa coverage` (add `--json` for machine-readable output).
914934
When choosing focused proof for a touched behavior or file path, run `pnpm openclaw qa coverage --match <query>`.
915935
The match report searches scenario metadata, docs refs, code refs, coverage IDs, plugins, and provider requirements, then prints matching `qa suite --scenario ...` targets.
916-
Every `qa suite` scenario execution writes a `qa-evidence.json` artifact. Flow scenarios also write `qa-suite-summary.json` for existing suite/report tooling; scenarios that declare `execution.kind: vitest` or `execution.kind: playwright` run the matching test path and write `qa-vitest-report.md` or `qa-playwright-report.md` plus per-scenario logs.
936+
Every `qa suite` run writes top-level `qa-evidence.json`,
937+
`qa-suite-summary.json`, and `qa-suite-report.md` artifacts for the selected
938+
scenario set. Scenarios that declare `execution.kind: vitest` or
939+
`execution.kind: playwright` run the matching test path and also write
940+
per-scenario logs.
917941
Treat it as a discovery aid, not a gate replacement; the selected scenario still needs the right provider mode, live transport, Multipass, Testbox, or release lane for the behavior under test.
918942

919943
For character and style checks, run the same scenario across multiple live model

‎docs/help/testing.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ inside every shard.
145145

146146
- `pnpm openclaw qa suite`
147147
- Runs repo-backed QA scenarios directly on the host.
148+
- Writes top-level `qa-evidence.json`, `qa-suite-summary.json`, and
149+
`qa-suite-report.md` artifacts for the selected scenario set, including
150+
mixed flow, Vitest, and Playwright scenario selections.
148151
- Runs multiple selected scenarios in parallel by default with isolated
149152
gateway workers. `qa-channel` defaults to concurrency 4 (bounded by the
150153
selected scenario count). Use `--concurrency <count>` to tune the worker

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

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ import {
8383
runQaJsonlReplayCommand,
8484
runQaManualLaneCommand,
8585
runQaParityReportCommand,
86+
runQaProfileCommand,
8687
runQaSuiteCommand,
8788
} from "./cli.runtime.js";
8889
import { QaSuiteInfraError } from "./errors.js";
@@ -139,21 +140,22 @@ function flowSuiteRuntimeResult(params: {
139140
};
140141
}
141142

142-
function testFileSuiteRuntimeResult(params: {
143+
function unifiedSuiteRuntimeResult(params: {
143144
evidencePath: string;
144-
executionKind?: "vitest" | "playwright";
145145
outputDir: string;
146146
reportPath: string;
147-
results?: unknown[];
147+
summaryPath: string;
148+
scenarios?: unknown[];
148149
}) {
149150
return {
150-
executionKind: params.executionKind ?? "playwright",
151+
executionKind: "suite",
151152
result: {
152153
outputDir: params.outputDir,
153-
executionKind: params.executionKind ?? "playwright",
154154
reportPath: params.reportPath,
155155
evidencePath: params.evidencePath,
156-
results: params.results ?? [{ status: "pass" }],
156+
summaryPath: params.summaryPath,
157+
report: "# QA Suite Report\n",
158+
scenarios: params.scenarios ?? [],
157159
},
158160
};
159161
}
@@ -301,9 +303,10 @@ describe("qa cli runtime", () => {
301303
const evidencePath = path.join(suiteArtifactsDir, "qa-evidence.json");
302304
await fs.writeFile(evidencePath, JSON.stringify({ entries: [] }), "utf8");
303305
runQaSuite.mockResolvedValueOnce(
304-
testFileSuiteRuntimeResult({
306+
unifiedSuiteRuntimeResult({
305307
outputDir: suiteArtifactsDir,
306308
reportPath: suiteReportPath,
309+
summaryPath: suiteSummaryPath,
307310
evidencePath,
308311
}),
309312
);
@@ -325,6 +328,7 @@ describe("qa cli runtime", () => {
325328
scenarioIds: ["control-ui-chat-flow-playwright"],
326329
});
327330
expectWriteContains(stdoutWrite, `QA suite evidence: ${evidencePath}`);
331+
expectWriteContains(stdoutWrite, `QA suite summary: ${suiteSummaryPath}`);
328332
});
329333

330334
it("rejects host-only resource options for Playwright scenarios", async () => {
@@ -339,6 +343,75 @@ describe("qa cli runtime", () => {
339343
expect(runQaSuite).not.toHaveBeenCalled();
340344
});
341345

346+
it("dispatches a taxonomy-backed profile category through the suite runner", async () => {
347+
const previousProfile = process.env.OPENCLAW_QA_PROFILE;
348+
process.env.OPENCLAW_QA_PROFILE = "release";
349+
try {
350+
runQaSuite.mockImplementationOnce(async () => {
351+
expect(process.env.OPENCLAW_QA_PROFILE).toBe("smoke-ci");
352+
return flowSuiteRuntimeResult({
353+
reportPath: suiteReportPath,
354+
summaryPath: suiteSummaryPath,
355+
});
356+
});
357+
358+
await runQaProfileCommand({
359+
repoRoot: "/tmp/openclaw-repo",
360+
outputDir: ".artifacts/qa-e2e/smoke-ci",
361+
profile: "smoke-ci",
362+
surface: "agent-runtime-and-provider-execution",
363+
category: "agent-runtime-and-provider-execution.agent-turn-execution",
364+
transportId: "qa-channel",
365+
fastMode: true,
366+
concurrency: 2,
367+
allowFailures: true,
368+
});
369+
370+
const suiteArgs = mockFirstObjectArg(runQaSuite);
371+
expectFields(suiteArgs, {
372+
repoRoot: path.resolve("/tmp/openclaw-repo"),
373+
outputDir: path.resolve("/tmp/openclaw-repo", ".artifacts/qa-e2e/smoke-ci"),
374+
transportId: "qa-channel",
375+
providerMode: "mock-openai",
376+
fastMode: true,
377+
concurrency: 2,
378+
});
379+
expect(suiteArgs.scenarioIds).toEqual(expect.arrayContaining(["dm-chat-baseline"]));
380+
expect(suiteArgs.scenarioIds).not.toContain("thinking-slash-model-remap");
381+
expect(process.env.OPENCLAW_QA_PROFILE).toBe("release");
382+
expectWriteContains(stdoutWrite, "QA run profile: smoke-ci; categories: 1; scenarios:");
383+
} finally {
384+
if (previousProfile === undefined) {
385+
delete process.env.OPENCLAW_QA_PROFILE;
386+
} else {
387+
process.env.OPENCLAW_QA_PROFILE = previousProfile;
388+
}
389+
}
390+
});
391+
392+
it("rejects qa profile runs that do not match taxonomy categories", async () => {
393+
await expect(
394+
runQaProfileCommand({
395+
repoRoot: "/tmp/openclaw-repo",
396+
profile: "smoke-ci",
397+
surface: "unknown-surface",
398+
}),
399+
).rejects.toThrow(
400+
"qa run did not find taxonomy categories for --qa-profile smoke-ci --surface unknown-surface.",
401+
);
402+
expect(runQaSuite).not.toHaveBeenCalled();
403+
});
404+
405+
it("rejects qa profile runs whose profile is not declared in taxonomy.yaml", async () => {
406+
await expect(
407+
runQaProfileCommand({
408+
repoRoot: "/tmp/openclaw-repo",
409+
profile: "nightly",
410+
}),
411+
).rejects.toThrow('--qa-profile must be one of smoke-ci, release, got "nightly".');
412+
expect(runQaSuite).not.toHaveBeenCalled();
413+
});
414+
342415
it("resolves suite repo-root-relative paths before dispatching", async () => {
343416
await runQaSuiteCommand({
344417
repoRoot: "/tmp/openclaw-repo",

0 commit comments

Comments
 (0)