test: speed extension and contract scenarios

This commit is contained in:
Peter Steinberger
2026-05-06 00:54:06 +01:00
parent cb42efb6e6
commit 093b2b9b5f
16 changed files with 270 additions and 89 deletions

View File

@@ -325,6 +325,7 @@ describe("qa-lab server", () => {
port: 0,
repoRoot,
embeddedGateway: "disabled",
selfCheckWaitTimeoutMs: 1,
});
cleanups.push(async () => {
await lab.stop();

View File

@@ -244,6 +244,7 @@ export async function startQaLabServer(
transportId: "qa-channel",
outputPath: params?.outputPath,
repoRoot,
waitTimeoutMs: params?.selfCheckWaitTimeoutMs,
});
latestScenarioRun = withQaLabRunCounts({
kind: "self-check",

View File

@@ -55,6 +55,7 @@ export type QaLabServerStartParams = {
autoKickoffTarget?: string;
embeddedGateway?: string;
sendKickoffOnStart?: boolean;
selfCheckWaitTimeoutMs?: number;
};
export type QaLabServerHandle = {

View File

@@ -1,7 +1,10 @@
import { extractQaToolPayload } from "./extract-tool-payload.js";
import type { QaScenarioDefinition } from "./scenario.js";
export function createQaSelfCheckScenario(): QaScenarioDefinition {
export function createQaSelfCheckScenario(options?: {
waitTimeoutMs?: number;
}): QaScenarioDefinition {
const waitTimeoutMs = options?.waitTimeoutMs ?? 5_000;
return {
name: "Synthetic Slack-class roundtrip",
steps: [
@@ -18,7 +21,7 @@ export function createQaSelfCheckScenario(): QaScenarioDefinition {
kind: "message-text",
textIncludes: "qa-echo: hello from qa",
direction: "outbound",
timeoutMs: 5_000,
timeoutMs: waitTimeoutMs,
});
},
},
@@ -52,7 +55,7 @@ export function createQaSelfCheckScenario(): QaScenarioDefinition {
kind: "message-text",
textIncludes: "qa-echo: inside thread",
direction: "outbound",
timeoutMs: 5_000,
timeoutMs: waitTimeoutMs,
});
return threadId;
},

View File

@@ -29,6 +29,7 @@ export async function runQaSelfCheckAgainstState(params: {
outputPath?: string;
repoRoot?: string;
notes?: string[];
waitTimeoutMs?: number;
}): Promise<QaSelfCheckResult> {
const startedAt = new Date();
const transport = createQaTransportAdapter({
@@ -36,16 +37,19 @@ export async function runQaSelfCheckAgainstState(params: {
state: params.state,
});
params.state.reset();
const scenarioResult = await runQaScenario(createQaSelfCheckScenario(), {
state: params.state,
performAction: async (action, args) =>
await transport.handleAction({
action,
args,
cfg: params.cfg,
accountId: transport.accountId,
}),
});
const scenarioResult = await runQaScenario(
createQaSelfCheckScenario({ waitTimeoutMs: params.waitTimeoutMs }),
{
state: params.state,
performAction: async (action, args) =>
await transport.handleAction({
action,
args,
cfg: params.cfg,
accountId: transport.accountId,
}),
},
);
const checks = [
{
name: "QA self-check scenario",