Skip to content

testing(feat[replay]): Replay failed pytest runs - #139

Merged
tony merged 1 commit into
masterfrom
concept/pytest-replay
Dec 5, 2026
Merged

tony merged 1 commit into
masterfrom
concept/pytest-replay

Conversation

@tony

@tony tony commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Add opt-in --vt-replay-dir failure capture to libvt.pytest_plugin, offline python -m libvt replay verification (including --chunk-size 1 and stdin), and exact cell-difference reporting in libvt.testing.assert_screen.

  • Records normalized input bytes, ordered resizes, initial encoding, and observed frames via TerminalRecorder without test-only state on Screen or Snapshot.
  • Captures assertion frames safely across worker threads and assert_screen_box, releases item.stash after call/teardown, and anchors relative --vt-replay-dir paths to pytest invocation directory across chdir.
  • Validates artifact schema, bounds, and whitespace-free hex strictly on load; handles legacy ?2027l segmentation (CLUSTER_NONE), wide-wrap SPACER_HEAD, BCE blanks, and open ?2026 held frames.
  • Adds examples/replay_prompt.py (packaged via sdist), tests in tests/test_testing.py / tests/test_codec.py, and docs in docs/topics/testing.md, README.md, and CHANGES.

Fixes #136
Fixes #127
Fixes #117

@tony
tony force-pushed the concept/pytest-replay branch from f47da1d to 7dda244 Compare December 1, 2026 03:31
tony added a commit that referenced this pull request Dec 3, 2026
why: Record the branch's user-visible change in the unreleased notes.

what:
- Add the #139 entry under What's new in CHANGES
- Add the #139 entry under Fixes in CHANGES
@tony
tony force-pushed the concept/pytest-replay branch from 7dda244 to 07463a6 Compare December 3, 2026 02:54
@tony
tony force-pushed the concept/pytest-replay branch from 07463a6 to 54321df Compare December 3, 2026 23:58
@tony
tony force-pushed the concept/pytest-replay branch from 54321df to fcbc53b Compare December 5, 2026 14:53
@tony
tony force-pushed the concept/pytest-replay branch from fcbc53b to eaba00e Compare December 5, 2026 15:06
@tony
tony force-pushed the concept/pytest-replay branch from eaba00e to 8ef451d Compare December 5, 2026 15:33
why: Visually identical screen boxes can hide trailing spaces or
out-of-bounds expected rows, and flight-recorder byte tails alone omit
external resizes, worker-thread assertion frames, and initial encoding
needed to reproduce failing pytest runs offline.

what:
- Add opt-in --vt-replay-dir capture in libvt.pytest_plugin using
  lock-protected _ReplayCapture on TerminalRecorder, thread-safe
  mismatch observers for assert_screen/assert_screen_box (including
  worker threads), invocation-dir path anchoring, and item.stash cleanup
  after call/teardown.
- Add python -m libvt replay CLI with strict artifact schema/hex
  validation, whole-feed and --chunk-size playback, and stdin support.
- Report exact first differing row/column or cursor mismatch in
  libvt.testing.assert_screen with legacy ?2027l CLUSTER_NONE fidelity.
- Add examples/replay_prompt.py (packaged via sdist), unit/PTY/CLI and
  schema tests, docs/topics/testing.md, README.md, and CHANGES entries.

Fixes #136
Fixes #127
Fixes #117
@tony
tony marked this pull request as ready for review December 5, 2026 17:46
@tony
tony force-pushed the concept/pytest-replay branch from 8ef451d to f180c75 Compare December 5, 2026 17:46
@tony tony changed the title Concept: Replay a failed pytest terminal screen offline testing(feat[replay]): Replay failed pytest runs Dec 5, 2026
@tony
tony merged commit f00ea2b into master Dec 5, 2026
9 checks passed
@tony
tony deleted the concept/pytest-replay branch December 5, 2026 17:50
@tony tony mentioned this pull request Dec 5, 2026
35 of 38 tasks

This branch was successfully deployed

1 active deployment
docs — f180c753 Deployed Dec 5, 2026 by tony via build (3.14) #520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant