fix(ci): preserve all cases in selected test shards (#12425)

* fix(ci): keep test-name filters out of selected shards

* fix(ci): reject parsed name filters in selected test shards

* fix(ci): reject parsed tag filters in selected test shards

---------

Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-11-19 20:09:12 +00:00
1 parent e79e57552f
commit 2206984be2
3 files changed
+92 -2

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ if (group === "selected") {
throw new Error("Selected test groups are already sharded");
runner = [
resolve("scripts/run-exact-tests.mjs"),
"run",
"ci-selected",
`--shard=${shard}`,
...rest,
...plan.files,
+9 -1
View File
@@ -5,7 +5,15 @@ import { createVitest, parseCLI } from "vitest/node";
// CLI file filters are substring matches. Select discovered specifications by
// identity instead, retaining each project's include/exclude and runner settings.
const { filter, options } = parseCLI(["vitest", ...process.argv.slice(2)]);
const args = process.argv.slice(2);
const ciSelected = args[0] === "ci-selected";
if (ciSelected) args[0] = "run";
const { filter, options } = parseCLI(["vitest", ...args]);
if (
ciSelected &&
(options.testNamePattern !== undefined || options.tagsFilter !== undefined)
)
throw new Error("Selected test groups cannot filter cases by name or tag");
const vitest = await createVitest({ ...options, watch: false });
const signalExitCodes = { SIGINT: 130, SIGTERM: 143 };
let shutdownSignal;