

























@@ -42,7 +42,11 @@ import {
4242type QaProviderModeInput,
4343} from "./run-config.js";
4444import type { RuntimeId } from "./runtime-parity.js";
45-import { readQaScenarioPack } from "./scenario-catalog.js";
45+import {
46+QA_RUNTIME_PARITY_TIERS,
47+readQaScenarioPack,
48+type QaRuntimeParityTier,
49+} from "./scenario-catalog.js";
4650import { resolveQaScenarioPackScenarioIds } from "./scenario-packs.js";
4751import { runQaSuiteFromRuntime } from "./suite-launch.runtime.js";
4852import { readQaSuiteFailedScenarioCountFromSummary } from "./suite-summary.js";
@@ -163,6 +167,47 @@ function parseQaRuntimePair(value: string | undefined): [RuntimeId, RuntimeId] |
163167return ["pi", "codex"];
164168}
165169170+function parseQaRuntimeParityTierFilters(input: string[] | undefined): QaRuntimeParityTier[] {
171+const rawValues = [
172+ ...new Set(
173+(input ?? [])
174+.flatMap((value) => value.split(","))
175+.map((value) => value.trim().toLowerCase())
176+.filter(Boolean),
177+),
178+];
179+const validTiers = new Set<string>(QA_RUNTIME_PARITY_TIERS);
180+for (const value of rawValues) {
181+if (!validTiers.has(value)) {
182+throw new Error(
183+`--runtime-parity-tier must be one of ${QA_RUNTIME_PARITY_TIERS.join(", ")}, got "${value}".`,
184+);
185+}
186+}
187+return rawValues as QaRuntimeParityTier[];
188+}
189+190+function resolveQaRuntimeParityTierScenarioIds(params: {
191+scenarioIds: string[];
192+runtimeParityTiers: readonly QaRuntimeParityTier[];
193+}): string[] {
194+if (params.runtimeParityTiers.length === 0) {
195+return params.scenarioIds;
196+}
197+const tierSet = new Set(params.runtimeParityTiers);
198+const matchingScenarioIds = readQaScenarioPack()
199+.scenarios.filter(
200+(scenario) => scenario.runtimeParityTier && tierSet.has(scenario.runtimeParityTier),
201+)
202+.map((scenario) => scenario.id);
203+if (matchingScenarioIds.length === 0) {
204+throw new Error(
205+`--runtime-parity-tier matched no scenarios for ${params.runtimeParityTiers.join(", ")}.`,
206+);
207+}
208+return [...new Set([...params.scenarioIds, ...matchingScenarioIds])];
209+}
210+166211async function readQaFailedScenarioCountFromSummary(summaryPath: string) {
167212let summaryText: string;
168213try {
@@ -513,17 +558,23 @@ export async function runQaSuiteCommand(opts: {
513558disk?: string;
514559preflight?: boolean;
515560runtimePair?: string;
561+runtimeParityTier?: string[];
516562}) {
517563const repoRoot = path.resolve(opts.repoRoot ?? process.cwd());
518564const transportId = normalizeQaTransportId(opts.transportId);
519565const runner = (opts.runner ?? "host").trim().toLowerCase();
520-const scenarioIds = resolveQaScenarioPackScenarioIds({
566+const explicitScenarioIds = resolveQaScenarioPackScenarioIds({
521567pack: opts.pack,
522568scenarioIds: resolveQaParityPackScenarioIds({
523569parityPack: opts.parityPack,
524570scenarioIds: opts.scenarioIds,
525571}),
526572});
573+const runtimeParityTiers = parseQaRuntimeParityTierFilters(opts.runtimeParityTier);
574+const scenarioIds = resolveQaRuntimeParityTierScenarioIds({
575+scenarioIds: explicitScenarioIds,
576+ runtimeParityTiers,
577+});
527578const allowFailures = opts.allowFailures === true;
528579if (runner !== "host" && runner !== "multipass") {
529580throw new Error(`--runner must be one of host or multipass, got "${opts.runner}".`);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。