QA: split Matrix scenario leaf types

This commit is contained in:
Gustavo Madeira Santana
2026-04-14 21:16:48 -04:00
parent 4c52731051
commit 3c03d41f13
4 changed files with 64 additions and 52 deletions

View File

@@ -107,7 +107,7 @@ type MatrixQaArtifactPaths = {
summary: string;
};
function countMatrixQaStatuses<T extends { status: "fail" | "pass" }>(entries: T[]) {
function countMatrixQaStatuses<T extends { status: "fail" | "pass" | "skip" }>(entries: T[]) {
return {
failed: entries.filter((entry) => entry.status === "fail").length,
passed: entries.filter((entry) => entry.status === "pass").length,

View File

@@ -14,7 +14,7 @@ import type {
MatrixQaCanaryArtifact,
MatrixQaReplyArtifact,
MatrixQaScenarioExecution,
} from "./scenarios.js";
} from "./scenario-types.js";
type MatrixQaActorId = "driver" | "observer";

View File

@@ -0,0 +1,51 @@
import type { MatrixQaObservedEvent } from "../../substrate/events.js";
export type MatrixQaReplyArtifact = {
bodyPreview?: string;
eventId: string;
mentions?: MatrixQaObservedEvent["mentions"];
relatesTo?: MatrixQaObservedEvent["relatesTo"];
sender?: string;
tokenMatched?: boolean;
};
export type MatrixQaCanaryArtifact = {
driverEventId: string;
reply: MatrixQaReplyArtifact;
token: string;
};
export type MatrixQaScenarioArtifacts = {
actorUserId?: string;
driverEventId?: string;
expectedNoReplyWindowMs?: number;
reactionEmoji?: string;
reactionEventId?: string;
reactionTargetEventId?: string;
reply?: MatrixQaReplyArtifact;
recoveredDriverEventId?: string;
recoveredReply?: MatrixQaReplyArtifact;
roomKey?: string;
restartSignal?: string;
rootEventId?: string;
threadDriverEventId?: string;
threadReply?: MatrixQaReplyArtifact;
threadRootEventId?: string;
threadToken?: string;
token?: string;
topLevelDriverEventId?: string;
topLevelReply?: MatrixQaReplyArtifact;
topLevelToken?: string;
triggerBody?: string;
membershipJoinEventId?: string;
membershipLeaveEventId?: string;
noticeBodyPreview?: string;
noticeEventId?: string;
transportInterruption?: string;
joinedRoomId?: string;
};
export type MatrixQaScenarioExecution = {
artifacts?: MatrixQaScenarioArtifacts;
details: string;
};

View File

@@ -1,4 +1,3 @@
import type { MatrixQaObservedEvent } from "../../substrate/events.js";
import {
MATRIX_QA_DRIVER_DM_ROOM_KEY,
MATRIX_QA_DRIVER_DM_SHARED_ROOM_KEY,
@@ -23,6 +22,12 @@ import {
type MatrixQaScenarioContext,
type MatrixQaSyncState,
} from "./scenario-runtime.js";
import type {
MatrixQaCanaryArtifact,
MatrixQaReplyArtifact,
MatrixQaScenarioArtifacts,
MatrixQaScenarioExecution,
} from "./scenario-types.js";
export type { MatrixQaScenarioDefinition, MatrixQaScenarioId };
export {
@@ -37,55 +42,11 @@ export {
runMatrixQaCanary,
runMatrixQaScenario,
};
export type MatrixQaReplyArtifact = {
bodyPreview?: string;
eventId: string;
mentions?: MatrixQaObservedEvent["mentions"];
relatesTo?: MatrixQaObservedEvent["relatesTo"];
sender?: string;
tokenMatched?: boolean;
};
export type MatrixQaCanaryArtifact = {
driverEventId: string;
reply: MatrixQaReplyArtifact;
token: string;
};
export type MatrixQaScenarioArtifacts = {
actorUserId?: string;
driverEventId?: string;
expectedNoReplyWindowMs?: number;
reactionEmoji?: string;
reactionEventId?: string;
reactionTargetEventId?: string;
reply?: MatrixQaReplyArtifact;
recoveredDriverEventId?: string;
recoveredReply?: MatrixQaReplyArtifact;
roomKey?: string;
restartSignal?: string;
rootEventId?: string;
threadDriverEventId?: string;
threadReply?: MatrixQaReplyArtifact;
threadRootEventId?: string;
threadToken?: string;
token?: string;
topLevelDriverEventId?: string;
topLevelReply?: MatrixQaReplyArtifact;
topLevelToken?: string;
triggerBody?: string;
membershipJoinEventId?: string;
membershipLeaveEventId?: string;
noticeBodyPreview?: string;
noticeEventId?: string;
transportInterruption?: string;
joinedRoomId?: string;
};
export type MatrixQaScenarioExecution = {
artifacts?: MatrixQaScenarioArtifacts;
details: string;
export type {
MatrixQaCanaryArtifact,
MatrixQaReplyArtifact,
MatrixQaScenarioArtifacts,
MatrixQaScenarioExecution,
};
export type { MatrixQaScenarioContext, MatrixQaSyncState };