diff --git a/tests/sim/extension.ts b/tests/sim/extension.ts index df372b6..81aa0f3 100644 --- a/tests/sim/extension.ts +++ b/tests/sim/extension.ts @@ -108,7 +108,13 @@ function* startPlan(trigger: string): MainPlan { }, }, }; - for (const id of opened.value?.launchable ?? []) yield { call: { name: "dispatch_step", args: { ticketId: id, launch: true } } }; + for (const id of opened.value?.launchable ?? []) + yield { + call: { + name: "dispatch_step", + args: { ticketId: id, launch: true, ...(scenario.launchRole === undefined ? {} : { role: scenario.launchRole }) }, + }, + }; } function* attentionPlan(trigger: string): MainPlan { diff --git a/tests/sim/run.ts b/tests/sim/run.ts index 0cffeb8..3be3ab9 100644 --- a/tests/sim/run.ts +++ b/tests/sim/run.ts @@ -318,8 +318,8 @@ function normalizeDispatchCall(name: string | undefined, args: Record [...(await tree.check(run)), ...(await meerkatChecks(run))], }); +const head = cases.find((item) => item.name === "head")!; +const ROLE_LAUNCH = "Main named a role in launch"; +cases.push({ + ...head, + name: "launch-role", + scenario: (markers) => ({ ...head.scenario(markers), launchRole: "owner" }), + check: async (run) => { + const failures = await head.check(run); + return failures.includes(ROLE_LAUNCH) + ? failures.filter((failure) => failure !== ROLE_LAUNCH) + : [...failures, `${ROLE_LAUNCH} went unreported`]; + }, +}); cases.push(...askCases({ agenda, waitUntil, start, kill, modelLog, seatSessions, simState, commonChecks })); const selected = process.argv.slice(2); diff --git a/tests/sim/scenario.ts b/tests/sim/scenario.ts index 1a4590a..56cdf2a 100644 --- a/tests/sim/scenario.ts +++ b/tests/sim/scenario.ts @@ -57,6 +57,7 @@ export const scenarioSchema = z.object({ workRoles: z.array(z.string()), retryFailed: z.string().optional(), resumeFirst: z.string().optional(), + launchRole: z.string().optional(), log: z.string(), }); export type Scenario = z.infer;