Split out from review of #1483.
Problem
In multi-project browser mode, createBrowserRuntime builds one isolated dev server per browser project from getBrowserProjects(context) (every browser project), and listBrowserTests collects from all runtime.projectServers. Each per-project manifest enumerates tests via import.meta.webpackContext(projectRoot, { regExp: include }), which ignores the per-shard testFiles filter.
So when rstest list --shard omits some browser projects from projectEntries (the sharded set), the list output still includes those omitted projects' tests. Before the per-project-instance refactor (#1483) the single shared manifest was built from projectEntries, so omitted projects were never enumerated.
Scope
Edge case only: rstest list + --shard + ≥2 browser projects. The normal rstest run path and single-shard/single-project list are unaffected.
Fix options
- Minimal: in
listBrowserTests, collect only from servers whose project is present in projectEntries.
- Deeper: in
createBrowserRuntime, build servers only for projects present in projectEntries (also removes the "a server per browser project even when filtered" startup waste), adjusting containerServer derivation accordingly.
- Carry the shard
testFiles filter into the per-project manifest so within-project shard filtering is honored too (the broadest fix).
Split out from review of #1483.
Problem
In multi-project browser mode,
createBrowserRuntimebuilds one isolated dev server per browser project fromgetBrowserProjects(context)(every browser project), andlistBrowserTestscollects from allruntime.projectServers. Each per-project manifest enumerates tests viaimport.meta.webpackContext(projectRoot, { regExp: include }), which ignores the per-shardtestFilesfilter.So when
rstest list --shardomits some browser projects fromprojectEntries(the sharded set), the list output still includes those omitted projects' tests. Before the per-project-instance refactor (#1483) the single shared manifest was built fromprojectEntries, so omitted projects were never enumerated.Scope
Edge case only:
rstest list+--shard+ ≥2 browser projects. The normalrstest runpath and single-shard/single-project list are unaffected.Fix options
listBrowserTests, collect only from servers whose project is present inprojectEntries.createBrowserRuntime, build servers only for projects present inprojectEntries(also removes the "a server per browser project even when filtered" startup waste), adjustingcontainerServerderivation accordingly.testFilesfilter into the per-project manifest so within-project shard filtering is honored too (the broadest fix).