feat!: drop Playwright trace recording

Closed
OK
20d ago
+782-2215

Playwright trace zips were the debugging artifact for a failed test, but an agent can't read one without a GUI viewer, the screencast is withheld after a secret fill, and devices have no trace at all. This removes trace recording. The failure pages in the stacked PR take its place.

  • trace in the config or on a target is INVALID_CONFIG, on a test, describe, or setup COLLECTION_ERROR, and --trace (bare or with a mode) on run and explore exits 2. Each names the replacement: the markdown reporter's failure pages, or video for a recording.
  • video keeps every mode and the config < target < CLI < test precedence. trace-modes.test.ts is ported to video-modes.test.ts, so on-all-retries, retain-on-failure, serial groups, and test-beats-config stay covered.
  • Engine contract: startTrace/stopTrace leave EngineArtifacts. An engine published before this (@e2e-dev/web@0.11.2 allows e2e >=0.15 <1) still declares them, so the manifest accepts and never calls them (packages/e2e/src/engine/manifest.ts, RETIRED_HOOKS) and updating e2e alone keeps working.
  • report-1 drops the trace artifact kind, trace in artifactCapabilities, and the not-required redaction; TRACE_WITHHELD is gone. Schema, valid fixture, and producer change together.
  • Dead code deleted: run/trace-redaction.ts, internal/zip.ts, the ledger's appearsIn, the web engine's trace segments around restarts and CDP recovery, telemetry's config_trace_modes. redactFragments stays: text downloads use it since #806.
  • A video segment waits up to 1s for its first frame before it ends (packages/web/src/video.ts). Without the trace keeping the screencast busy, a segment stopped right after a navigation got no frame on Linux, and Playwright writes that as a white video: the video.webm inked 0 failure main also hit. Reproduced and verified in the mcr.microsoft.com/playwright:v1.63.0-noble container.
  • The late route-handler tests route a script the page waits for (/script-flags) instead of a fetch it issues after load, which raced the end of the body once tracing no longer slowed it.

Verified

Ran it locally: yes

  • testbed, e2e run tests/todos.e2e.ts: 7 passed, no trace/ directory or zip written. --video still writes one .webm per attempt.
  • trace: 'on' in a copy of the testbed config, --trace, --trace=on, and explore --trace off: each refused, exit 2, with the replacement message.
  • The packed e2e from this branch with the published @e2e-dev/web@0.11.2 and playwright@1.63.0 in a scratch project: the config loads and the test runs (before the manifest fix it was INVALID_CONFIG: engine "web": artifacts has unknown key "startTrace").
 FAIL  |web| tests/hello.e2e.ts > hello
ASSERTION_FAILED: expect.toHaveText failed
      Tests  1 failed | 0 passed (1)

(The failure is the deliberate assertion; no config error.)