fix(run): serial group failures reach the exit code and the reporters
A serial group whose session failed to launch skipped every member and the run passed with exit 0. Serial failures also never reached the exit code's category fold, so an infrastructure error in a group exited 1, not 3.
- Exit code folds serial groups too (
packages/e2e/src/run/runner.ts,verdictExitCodes). Members carry no attempts, so the group's attempts are where the error category lives. - A group attempt that ends before any member runs (file load, session launch) fails the first member with the error; the rest skip as
serial-predecessor-failed. An interrupt during that launch skips every member instead (endBeforeMembersinpackages/e2e/src/run/serial.ts). - A retry that never reached its members keeps the member verdicts of the attempt before it, so a launch failure on attempt 1 cannot erase attempt 0's assertion failure or blame a member that passed.
- Worker crash during a serial member: that member fails with
WORKER_CRASHinstead of being skipped as never started (packages/e2e/src/run/scheduler.ts).
Stacked PR on top: a crash during a retry still drops earlier attempts, and a crash after a member's body ended (in an afterAll, the session close) is still charged to that member. Both are fixed there by streaming finished attempts from the worker.
Verified
Ran it locally: yes
Scratch project in /tmp with a custom engine whose startAttempt throws ENGINE_FAILURE, one serial describe with two members, run with the built CLI from origin/main and from this branch.
| main | this branch |
|---|---|
both members skipped, exit 0, report status: passed | step 1 fails with ENGINE_FAILURE, step 2 skipped, exit 3, report status: error |
# main
↓ |device| tests/wizard.e2e.ts (2 tests | 2 skipped)
↓ wizard > step 1 [device would not boot]
↓ wizard > step 2 [device would not boot]
Test Files 0 passed | 1 skipped (1)
exit 0
# this branch
❯ |device| tests/wizard.e2e.ts (2 tests | 1 failed | 1 skipped)
× wizard > step 1 0ms
→ device would not boot
↓ wizard > step 2 [member 0 failed in this group attempt]
FAIL |device| tests/wizard.e2e.ts > wizard > step 1
ENGINE_FAILURE: device would not boot
exit 3
Same project, serial group whose second member calls process.exit(7), --workers 1:
# main
↓ wizard > step 1 passes [worker process exited before this test started]
↓ wizard > step 2 crashes the worker [worker process exited before this test started]
↓ wizard > step 3 never starts [worker process exited before this test started]
# this branch
↓ wizard > step 1 passes [worker process exited before this serial group finished]
× wizard > step 2 crashes the worker 0ms
→ worker process exited during this test
↓ wizard > step 3 never starts [worker process exited before this test started]
New integration tests in engine-contract.test.ts (launch failure, member infra error, interrupted launch, retry launch failure) and parallel-workers.test.ts (serial crash) fail on the pre-fix code.