test(qa): log effective channel driver in progress (#96327)

This commit is contained in:
Dallin Romney
2026-06-24 01:04:52 -07:00
committed by GitHub
parent 560ecafa2d
commit bd43c36bb1
2 changed files with 57 additions and 1 deletions

View File

@@ -167,6 +167,32 @@ describe("qa suite", () => {
expect(qaSuiteProgressTesting.sanitizeQaSuiteProgressValue("\u0000\u0001")).toBe("<empty>");
});
it("includes effective channel driver in run start progress logs", () => {
expect(
qaSuiteProgressTesting.formatQaSuiteRunStartProgress({
selectedScenarioCount: 80,
concurrency: 8,
transportId: "qa-channel",
}),
).toBe("run start: scenarios=80 concurrency=8 transport=qa-channel");
expect(
qaSuiteProgressTesting.formatQaSuiteRunStartProgress({
selectedScenarioCount: 80,
concurrency: 1,
transportId: "qa-channel",
channelDriverSelection: {
capabilityMatrixPath: "crabline-fake-provider-capabilities.json",
channel: "telegram",
channelDriver: "crabline",
smokeArtifactPath: "crabline-fake-provider-smoke.json",
},
}),
).toBe(
"run start: scenarios=80 concurrency=1 transport=qa-channel channelDriver=crabline channel=telegram",
);
});
it("records gateway RSS peak and trace samples", () => {
expect(
qaSuiteProgressTesting.buildQaSuiteRuntimeMetrics({

View File

@@ -200,6 +200,29 @@ function writeQaSuiteProgress(enabled: boolean, message: string) {
process.stderr.write(`[qa-suite] ${message}\n`);
}
function formatQaSuiteRunStartProgress(params: {
selectedScenarioCount: number;
concurrency: number;
transportId: QaTransportId;
channelDriver?: QaScorecardChannelDriver | null;
channelDriverSelection?: OpenClawCrablineChannelDriverSelection | null;
}) {
const channelDriver = params.channelDriver ?? params.channelDriverSelection?.channelDriver;
const channel = params.channelDriverSelection?.channel;
const parts = [
`run start: scenarios=${params.selectedScenarioCount}`,
`concurrency=${params.concurrency}`,
`transport=${sanitizeQaSuiteProgressValue(params.transportId)}`,
];
if (channelDriver) {
parts.push(`channelDriver=${sanitizeQaSuiteProgressValue(channelDriver)}`);
}
if (channel) {
parts.push(`channel=${sanitizeQaSuiteProgressValue(channel)}`);
}
return parts.join(" ");
}
async function waitForQaLabReady(baseUrl: string, timeoutMs = 10_000) {
const startedAt = Date.now();
while (Date.now() - startedAt < timeoutMs) {
@@ -1185,7 +1208,13 @@ export async function runQaFlowSuite(params?: QaSuiteRunParams): Promise<QaSuite
const gatewayHeapCheckpointsEnabled = shouldCaptureGatewayHeapCheckpoints();
writeQaSuiteProgress(
progressEnabled,
`run start: scenarios=${selectedScenarios.length} concurrency=${concurrency} transport=${transportId}`,
formatQaSuiteRunStartProgress({
selectedScenarioCount: selectedScenarios.length,
concurrency,
transportId,
channelDriver: params?.channelDriver,
channelDriverSelection: params?.channelDriverSelection,
}),
);
const useIsolatedScenarioWorkers = shouldRunQaSuiteWithIsolatedScenarioWorkers({
scenarios: selectedScenarios,
@@ -1767,6 +1796,7 @@ export const qaSuiteProgressTesting = {
buildQaGatewayHeapCheckpointRuntimeEnvPatch,
buildQaIsolatedScenarioWorkerParams,
buildQaSuiteRuntimeMetrics,
formatQaSuiteRunStartProgress,
buildQaRuntimeEnvPatch,
mergeQaRuntimeEnvPatches,
parseQaSuiteBooleanEnv,