Skip to content

fix: preserve runner suites and route selected tests safely - #34

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/runner-universe-safety
Oct 22, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/runner-universe-safety

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Summary

Preserve executable tests across runner declarations and route selected files to configurations that actually run them.

  • Keep literal include/exclude filenames. Bare excludes stay root-relative so they do not hide same-named tests in subdirectories.
  • Do not apply a default suite's exclusions, roots or ignore rules to the union of separately configured suites.
  • Apply each config's own restrictions when routing commands and retain every applicable explicit invocation for overlapping suites.
  • Refuse selected tests excluded by the default config instead of emitting a command that runs none of them.
  • Require full validation for unsupported root/rootDir declarations or mutations and for partial/implicit multi-config suites.
  • Invalidate pre-fix persisted dependency graphs.

Reproduction

One fixture declares both src/**/*.test.js and regression.test.js; the literal file imports the changed source, while an unrelated wildcard test keeps discovery nonempty. Another declares a default suite excluding integration tests plus a named suite including them. Both previously report COMPLETE, SELECTIVE, no selected tests and command synthesis OK. Routing a selected integration test directly also chose the excluding default config.

Final regression tests run against pristine sources produced 17 failures (including warm-cache invalidation) and 35 passes. All 52 targeted tests pass with the fix. Regressions cover these cases, per-config roots/ignores, overlapping invocations, literal exclusions, unsupported roots and implicit multi-config suites. Conservative refusal is used where static evidence cannot establish the full suite.

Validation

Validated on Node v24.19.0, Linux, from baseline 9d575cef7b1dd118300cd6298c9f85a8c1a44ad8:

  • npm run typecheck
  • npm run build
  • npm run audit:boundary
  • node --import tsx --test --test-concurrency=1 $(find tests -name '*.test.ts' | sort) — 351/351 passed
  • git diff --check

The original baseline passes 333/333 tests serially. Its default parallel run lost suite processes in this environment, so the complete suite was validated serially. Windows and Node 22 remain for CI. Tests analyze synthetic repositories and command plans; they do not install or execute Jest/Vitest.

Scope and cache coordination

This does not evaluate arbitrary configuration JavaScript. Known unsupported roots and ambiguous multi-config includes force full validation. Discovery can remain wider than the runner where narrowing cannot be proved, and command refusal is explicit.

Other independent safety PRs from this review also bump cache schema 2 to 3. If merged/released separately, advance the schema again (or otherwise invalidate intermediate-version graphs) for each subsequent analysis change. Do not reuse warmed graphs from an earlier subset of the fixes.

@adityankale190895

Copy link
Copy Markdown
Member

Hi @FredApps, we're relicensing DiffCI Core from AGPL-3.0-only to MIT and need your consent for this contribution. Details and the one-line consent reply are in #43. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants