fix(runner): validate numeric SDK list shards

Merged
RU
5d ago
+65-1

What and why

  • Validate numeric SDK shards before collection. list({ shard: { index: 1.5, total: 2 } }) currently selects tests, although the matching CLI flag is rejected. Zero, negative, non-finite, unsafe, and out-of-range values can also silently produce an empty or incorrect selection.
  • Use the existing INVALID_CONFIG classification: both numbers must be positive safe integers, and index must be from 1 through total. JavaScript callers passing shard: null also get this classified error. Valid shards keep their selections and test IDs; emitted TypeScript declarations remain byte-identical, with no nullable API widening.

Verified

Ran it locally: yes

  • The actual built e2e/runner list export and built e2e list CLI ran against real config files and registered test bodies in isolated scratch projects. Listing starts no app, engine or worker, makes no provider call, executes no test body and writes no run report.
Casemain 06bb7265this branch
13 invalid numeric SDK shardsAccepted without an errorINVALID_CONFIG
Unsharded, first, second, valid empty SDK selection2, 1, 1, 0 runnable testsSame counts and IDs
Matching CLI cases13 rejected with exit 2; four valid selectionsSame output and exit codes
Frozen public-barrel integration tests13 fail, four passAll 17 pass
  • Five frozen supplemental owners verify runtime classification and import boundaries. The public API exposes list; a separate test uses the built internal runner to verify its serialized configuration error. Original 17 owners remain unchanged.
Review repairPublished e1a5ae9This revision
JavaScript list({ shard: null })TypeError, no classified codeINVALID_CONFIG
Built internal runner with null shardTest-category ERROR, exit 1Configuration INVALID_CONFIG, exit 2
Invalid numeric shardRejected before config/test importsSame
Valid first/empty shardsBoth modules import; IDs stable; bodies never runSame
Supplemental native ownersTwo null assertions fail, three controls passAll five pass
  • Full check and build pass. The unchanged full suite passes: 4,157 tests passed, two skipped, including all 22 frozen owners. The original 34 public SDK/CLI cases remain byte-identical after this repair.
  • Required canonical browser comparison ran six pairs and 76 tests: outcomes, step sequences and counters match. Wall, suite and action timings are classified the same; one individual step remains unresolved. This is a behavior check, with no performance improvement claimed.
  • This fixes invalid SDK selection. Current signed head: cf6a71d56510d8752c6ffce845677712f00962a6; its upstream CI is pending. The earlier e1a5ae9 checks do not qualify that future head.