|
1 | 1 | // Qa Lab tests cover canonical scenario lane matching behavior. |
2 | 2 | import { describe, expect, it } from "vitest"; |
3 | 3 | import type { QaProviderMode } from "./model-selection.js"; |
| 4 | +import { resolveQaRunProfileExecutionSelection } from "./profile-planning.js"; |
4 | 5 | import { readQaScenarioById, readQaScenarioPack } from "./scenario-catalog.js"; |
| 6 | +import { requireFlowScenario } from "./scenario-catalog.test-utils.js"; |
5 | 7 | import { |
6 | 8 | describeQaProviderLaneMismatches, |
7 | 9 | resolveQaScenarioLaneChannels, |
@@ -71,6 +73,86 @@ describe("QA scenario lane matching", () => { |
71 | 73 | }, |
72 | 74 | ); |
73 | 75 |
|
| 76 | + it.each(["matrix-room-block-streaming", "matrix-voice-preflight-mention"])( |
| 77 | + "keeps the scenario-pinned provider for %s out of the live provider lane", |
| 78 | + (scenarioId) => { |
| 79 | + const scenario = readQaScenarioById(scenarioId); |
| 80 | + const liveLane = { |
| 81 | + scenario, |
| 82 | + providerMode: "live-frontier" as const, |
| 83 | + primaryModel: "openai/gpt-5.6-luna", |
| 84 | + channelDriver: "live" as const, |
| 85 | + channel: "matrix", |
| 86 | + }; |
| 87 | + |
| 88 | + expect(scenarioMatchesQaProviderLane(liveLane)).toBe(false); |
| 89 | + expect(describeQaProviderLaneMismatches(liveLane)).toEqual(["providerMode=mock-openai"]); |
| 90 | + }, |
| 91 | + ); |
| 92 | + |
| 93 | + it("excludes a mock-pinned Matrix scenario from a live profile execution", () => { |
| 94 | + const scenario = readQaScenarioById("matrix-room-block-streaming"); |
| 95 | + |
| 96 | + expect( |
| 97 | + resolveQaRunProfileExecutionSelection({ |
| 98 | + scenarios: [scenario], |
| 99 | + providerMode: "live-frontier", |
| 100 | + primaryModel: "openai/gpt-5.6-luna", |
| 101 | + channelDriver: "live", |
| 102 | + channel: "matrix", |
| 103 | + }), |
| 104 | + ).toEqual({ |
| 105 | + selectedScenarios: [], |
| 106 | + excludedScenarios: [{ scenario, reasons: ["providerMode=mock-openai"] }], |
| 107 | + }); |
| 108 | + }); |
| 109 | + |
| 110 | + it("treats matching execution and config provider pins as one lane requirement", () => { |
| 111 | + const scenario = requireFlowScenario( |
| 112 | + makeQaSuiteTestScenario("matching-provider-modes", { |
| 113 | + config: { requiredProviderMode: "mock-openai" }, |
| 114 | + }), |
| 115 | + ); |
| 116 | + scenario.execution.providerMode = "mock-openai"; |
| 117 | + |
| 118 | + expect( |
| 119 | + describeQaProviderLaneMismatches({ |
| 120 | + scenario, |
| 121 | + providerMode: "live-frontier", |
| 122 | + primaryModel: "openai/gpt-5.6-luna", |
| 123 | + }), |
| 124 | + ).toEqual(["providerMode=mock-openai"]); |
| 125 | + expect( |
| 126 | + scenarioMatchesQaProviderLane({ |
| 127 | + scenario, |
| 128 | + providerMode: "mock-openai", |
| 129 | + primaryModel: "mock-openai/gpt-5.6-luna", |
| 130 | + }), |
| 131 | + ).toBe(true); |
| 132 | + }); |
| 133 | + |
| 134 | + it.each(["mock-openai", "live-frontier"] as const)( |
| 135 | + "rejects conflicting execution and config provider pins on the %s lane", |
| 136 | + (providerMode) => { |
| 137 | + const scenario = requireFlowScenario( |
| 138 | + makeQaSuiteTestScenario("conflicting-provider-modes", { |
| 139 | + config: { requiredProviderMode: "live-frontier" }, |
| 140 | + }), |
| 141 | + ); |
| 142 | + scenario.execution.providerMode = "mock-openai"; |
| 143 | + |
| 144 | + expect(() => |
| 145 | + describeQaProviderLaneMismatches({ |
| 146 | + scenario, |
| 147 | + providerMode, |
| 148 | + primaryModel: "openai/gpt-5.6-luna", |
| 149 | + }), |
| 150 | + ).toThrow( |
| 151 | + "QA scenario conflicting-provider-modes declares conflicting provider modes: execution.providerMode=mock-openai, execution.config.requiredProviderMode=live-frontier", |
| 152 | + ); |
| 153 | + }, |
| 154 | + ); |
| 155 | + |
74 | 156 | it("keeps multi-channel metadata as OR eligibility while exposing every supported lane", () => { |
75 | 157 | const scenario = readQaScenarioById("thread-isolation"); |
76 | 158 |
|
|
0 commit comments