Skip to content

Commit 1d526c5

Browse files
authored
refactor(qa): adopt Crabline server artifacts (#118008)
* refactor(qa): adopt Crabline server artifacts * fix(deps): restore Crabline release-age guard
1 parent 411e233 commit 1d526c5

10 files changed

Lines changed: 47 additions & 35 deletions

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,9 +1205,11 @@ provider names.
12051205
## Transport adapters
12061206

12071207
`qa-lab` owns a generic transport seam for YAML QA scenarios. `qa-channel` is
1208-
the synthetic default. `crabline` starts local provider-shaped servers and
1209-
runs OpenClaw's normal channel plugins against them. `live` is reserved for
1210-
real provider credentials and external channels.
1208+
the synthetic default. `crabline` starts separate local provider servers and
1209+
runs OpenClaw's normal channel plugins against their provider-shaped REST and
1210+
streaming boundaries; it does not use Crabline's fixture-level local mock
1211+
providers. `live` is reserved for real provider credentials and external
1212+
channels.
12111213

12121214
At the architecture level, the split is:
12131215

‎extensions/qa-lab/src/ci-smoke-plan.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe("createQaSmokeCiPart", () => {
150150
expect(primaryScenarioIds.every((ids) => ids.length > 0)).toBe(true);
151151
});
152152

153-
it("keeps real Gateway-hosted proof outside the Crabline smoke profile", () => {
153+
it("keeps real Gateway-hosted proof outside the Crabline channel-driver profile", () => {
154154
const coverageId = "control-ui.gateway-hosted-ui-control";
155155
const smokeSelection = resolveQaProfileScenarios({
156156
profile: "smoke-ci",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ describe("qa cli runtime", () => {
10011001
},
10021002
);
10031003

1004-
it("filters QA-channel-pinned scenarios from an implicit Crabline smoke profile", async () => {
1004+
it("filters QA-channel-pinned scenarios from an implicit Crabline driver profile", async () => {
10051005
runQaSuite.mockImplementationOnce(async (params) => {
10061006
await fs.writeFile(suiteEvidencePath, JSON.stringify(makeQaEvidence()), "utf8");
10071007
const observedCells = executionCellsForSuiteParams(params);
@@ -1049,7 +1049,7 @@ describe("qa cli runtime", () => {
10491049
expect(runQaSuite).not.toHaveBeenCalled();
10501050
});
10511051

1052-
it("dispatches the Matrix restart scenario through the Crabline smoke profile", async () => {
1052+
it("dispatches the Matrix restart scenario through the Crabline driver profile", async () => {
10531053
await runQaProfileCommand({
10541054
repoRoot: "/tmp/openclaw-repo",
10551055
profile: "smoke-ci",

‎extensions/qa-lab/src/crabline-artifacts.ts‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import type { OpenClawCrablineChannelDriverSelection } from "@openclaw/crabline"
33

44
type QaCrablineChannelDriverArtifactPaths = {
55
capabilityMatrixPath: string;
6-
providerReadinessArtifactPath?: string;
7-
smokeArtifactPath: string;
6+
providerReadinessArtifactPath: string;
87
};
98

109
export type QaSuiteChannelDriverSelection = Omit<
1110
OpenClawCrablineChannelDriverSelection,
12-
"capabilityMatrixPath" | "providerReadinessArtifactPath" | "smokeArtifactPath"
11+
"capabilityMatrixPath" | "providerReadinessArtifactPath"
1312
> &
1413
QaCrablineChannelDriverArtifactPaths;
1514

@@ -31,14 +30,12 @@ export function resolveQaCrablineChannelDriverArtifactPaths(params: {
3130
if (!params.selection) {
3231
return undefined;
3332
}
34-
const providerReadinessArtifactPath =
35-
readArtifactPath(params.result?.providerReadinessArtifactPath) ??
36-
params.selection.providerReadinessArtifactPath;
3733
return {
3834
capabilityMatrixPath:
3935
readArtifactPath(params.result?.capabilityMatrixPath) ??
4036
params.selection.capabilityMatrixPath,
41-
providerReadinessArtifactPath,
42-
smokeArtifactPath: providerReadinessArtifactPath,
37+
providerReadinessArtifactPath:
38+
readArtifactPath(params.result?.providerReadinessArtifactPath) ??
39+
params.selection.providerReadinessArtifactPath,
4340
};
4441
}

‎extensions/qa-lab/src/crabline-transport.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Qa Lab tests cover Crabline local-provider transport integration behavior.
1+
// Qa Lab tests cover Crabline channel-driver integration with local provider servers.
22
import fs from "node:fs/promises";
33
import path from "node:path";
44
import type { OpenClawCrablineChannelDriverSelection } from "@openclaw/crabline";
@@ -97,7 +97,7 @@ describe("crabline transport", () => {
9797
expect(delivery.replyTo).toBe(delivery.to);
9898

9999
await expect(
100-
fs.access(path.join(outputDir, "crabline-fake-provider-server.json")),
100+
fs.access(path.join(outputDir, "crabline-provider-server.json")),
101101
).rejects.toMatchObject({ code: "ENOENT" });
102102
await expect(
103103
transport.sendInbound({
@@ -435,7 +435,9 @@ describe("crabline transport", () => {
435435
const env = transport.createRuntimeEnvPatch?.() ?? {};
436436
expect(env).toMatchObject({
437437
CRABLINE_WHATSAPP_ADMIN_TOKEN: expect.any(String),
438-
CRABLINE_WHATSAPP_RECORDER_PATH: expect.stringMatching(/whatsapp-fake-provider\.jsonl$/u),
438+
CRABLINE_WHATSAPP_RECORDER_PATH: expect.stringMatching(
439+
/whatsapp-provider-server\.jsonl$/u,
440+
),
439441
CRABLINE_WHATSAPP_SELF_JID: "[email protected]",
440442
OPENCLAW_WHATSAPP_WEB_SOCKET_URL: expect.stringMatching(
441443
/^ws:\/\/127\.0\.0\.1:\d+\/ws\/chat\?access_token=/u,

‎extensions/qa-lab/src/crabline-transport.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Qa Lab plugin module implements Crabline local-provider transport behavior.
1+
// Qa Lab plugin module implements Crabline channel-driver transport behavior against local provider servers.
22
import fs from "node:fs/promises";
33
import path from "node:path";
44
import {
@@ -404,7 +404,7 @@ class QaCrablineTransport extends QaStateBackedTransportAdapter {
404404
cfg: OpenClawConfig;
405405
accountId?: string | null;
406406
}) => {
407-
throw new Error(`Crabline local-provider transport does not support ${_params.action} yet.`);
407+
throw new Error(`Crabline channel-driver transport does not support ${_params.action} yet.`);
408408
};
409409

410410
createReportNotes = (_params: QaTransportReportParams) => [
@@ -435,7 +435,7 @@ export async function createQaCrablineTransportAdapter(params: {
435435
params.outputDir,
436436
"artifacts",
437437
"crabline",
438-
`${params.selection.channel}-fake-provider.jsonl`,
438+
`${params.selection.channel}-provider-server.jsonl`,
439439
);
440440
await fs.mkdir(path.dirname(recorderPath), { recursive: true });
441441
let observeEvent = (_event: unknown) => {};

‎extensions/qa-lab/src/suite-artifacts.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ export function buildQaSuiteSummaryJson(params: QaSuiteSummaryJsonParams): QaSui
124124
channelDriver: params.channelDriver ?? null,
125125
channel: params.channel ?? params.channelDriverSelection?.channel ?? null,
126126
channelCapabilityMatrixPath: params.channelDriverSelection?.capabilityMatrixPath ?? null,
127-
channelDriverSmokePath: params.channelDriverSelection?.smokeArtifactPath ?? null,
127+
// This persisted summary is unversioned; keep its existing key until a versioned migration.
128+
channelDriverSmokePath: params.channelDriverSelection?.providerReadinessArtifactPath ?? null,
128129
scenarioIds:
129130
params.scenarioIds && params.scenarioIds.length > 0 ? [...params.scenarioIds] : null,
130131
runtimePair: params.runtimePair ?? null,
@@ -218,8 +219,9 @@ export async function writeQaSuiteArtifacts(params: {
218219
path: effectiveChannelDriverSelection.capabilityMatrixPath,
219220
},
220221
{
222+
// Evidence schema v2 keeps this persisted kind until an explicit schema migration.
221223
kind: "channel-driver-smoke",
222-
path: effectiveChannelDriverSelection.smokeArtifactPath,
224+
path: effectiveChannelDriverSelection.providerReadinessArtifactPath,
223225
},
224226
]
225227
: []),

‎extensions/qa-lab/src/suite.summary-json.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ describe("buildQaSuiteSummaryJson", () => {
5353
...baseParams,
5454
channelDriver: "crabline",
5555
channelDriverSelection: {
56-
capabilityMatrixPath: "crabline-fake-provider-capabilities.json",
56+
capabilityMatrixPath: "crabline-channel-driver-capabilities.json",
5757
channel: "telegram",
5858
channelDriver: "crabline",
59-
smokeArtifactPath: "crabline-fake-provider-smoke.json",
59+
providerReadinessArtifactPath: "crabline-provider-readiness.json",
6060
},
6161
});
6262

6363
expect(json.run.channelDriver).toBe("crabline");
6464
expect(json.run.channel).toBe("telegram");
65-
expect(json.run.channelCapabilityMatrixPath).toBe("crabline-fake-provider-capabilities.json");
66-
expect(json.run.channelDriverSmokePath).toBe("crabline-fake-provider-smoke.json");
65+
expect(json.run.channelCapabilityMatrixPath).toBe("crabline-channel-driver-capabilities.json");
66+
expect(json.run.channelDriverSmokePath).toBe("crabline-provider-readiness.json");
6767
});
6868

6969
it("records realized non-Crabline channel metadata", () => {

‎extensions/qa-lab/src/suite.test.ts‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -724,16 +724,19 @@ describe("qa suite", () => {
724724
};
725725
};
726726
const capabilityMatrixPath = summary.run?.channelCapabilityMatrixPath;
727-
const smokeArtifactPath = summary.run?.channelDriverSmokePath;
728-
if (typeof capabilityMatrixPath !== "string" || typeof smokeArtifactPath !== "string") {
727+
const providerReadinessArtifactPath = summary.run?.channelDriverSmokePath;
728+
if (
729+
typeof capabilityMatrixPath !== "string" ||
730+
typeof providerReadinessArtifactPath !== "string"
731+
) {
729732
throw new Error("Crabline generation artifact paths missing from QA summary.");
730733
}
731734
const artifactGenerationDirectory = path.dirname(capabilityMatrixPath);
732735
expect(path.dirname(artifactGenerationDirectory)).toBe(".crabline-channel-driver-artifacts");
733736
expect(path.basename(artifactGenerationDirectory)).toMatch(/^generation-[^/\\]+$/u);
734737
expect(path.basename(capabilityMatrixPath)).toBe("crabline-channel-driver-capabilities.json");
735-
expect(path.dirname(smokeArtifactPath)).toBe(artifactGenerationDirectory);
736-
expect(path.basename(smokeArtifactPath)).toBe("crabline-provider-readiness.json");
738+
expect(path.dirname(providerReadinessArtifactPath)).toBe(artifactGenerationDirectory);
739+
expect(path.basename(providerReadinessArtifactPath)).toBe("crabline-provider-readiness.json");
737740
await expect(
738741
fs.access(path.join(outputDir, "crabline-channel-driver-capabilities.json")),
739742
).rejects.toMatchObject({ code: "ENOENT" });
@@ -749,10 +752,13 @@ describe("qa suite", () => {
749752
expect(matrix.report?.result?.supportedChannels?.toSorted()).toEqual(
750753
[...CRABLINE_SERVER_CHANNELS].toSorted(),
751754
);
752-
const smoke = JSON.parse(
753-
await fs.readFile(path.resolve(outputDir, smokeArtifactPath), "utf8"),
755+
const readiness = JSON.parse(
756+
await fs.readFile(path.resolve(outputDir, providerReadinessArtifactPath), "utf8"),
754757
) as { providerReadiness?: { result?: { ok?: boolean; provider?: string } } };
755-
expect(smoke.providerReadiness?.result).toMatchObject({ ok: true, provider: "telegram" });
758+
expect(readiness.providerReadiness?.result).toMatchObject({
759+
ok: true,
760+
provider: "telegram",
761+
});
756762
const evidence = JSON.parse(await fs.readFile(artifacts.evidencePath, "utf8")) as {
757763
entries?: Array<{
758764
execution?: {
@@ -765,7 +771,11 @@ describe("qa suite", () => {
765771
expect(evidence.entries?.[0]?.execution?.artifacts).toEqual(
766772
expect.arrayContaining([
767773
{ kind: "channel-capability-matrix", path: capabilityMatrixPath, source: "qa-suite" },
768-
{ kind: "channel-driver-smoke", path: smokeArtifactPath, source: "qa-suite" },
774+
{
775+
kind: "channel-driver-smoke",
776+
path: providerReadinessArtifactPath,
777+
source: "qa-suite",
778+
},
769779
]),
770780
);
771781
expect(evidence.entries?.[0]?.execution?.channel).toMatchObject({

‎pnpm-workspace.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ packages:
88
minimumReleaseAge: 2880
99

1010
minimumReleaseAgeExclude:
11-
- "@openclaw/[email protected]"
1211
- "@openclaw/[email protected]"
1312
- "@openclaw/[email protected]"
1413
- "@openclaw/[email protected]"

0 commit comments

Comments
 (0)