Skip to content

browser: list --shard lists tests from projects outside the current shard (multi browser project) #1484

Description

@fi3ework

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions