From f4e0365f8ab1764fd48a4067df0bfe3e89a137d1 Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Wed, 4 Nov 2026 11:43:44 +0700 Subject: [PATCH] chore(deps): termlens 0.11.8, and the report action with it Locked at 0.11.7. 0.11.8 is a patch and changed none of its dependency requirements, so the `"0.11"` requirement stays and only termlens's version and checksum move in the lock. `cargo update -p termlens` also swapped tempfile's getrandom pick; that hunk is left out, and the lock checks with `cargo metadata --locked`. Of what arrives, what this repository can see. The graphics probe sends kitty's `a=q` with `i=7379` and no upload in progress, so it is still answered `OK` (termlens#639, #672). crossterm's mouse capture enables 1015 and then 1006; 0.11.8 honours 1015 (termlens#640), but the last of the two set is in force, so the reports stay SGR and the click and scroll tests in smoke.rs hold unchanged. `tests/emulation.rs` pins `unsupported()` to `^[[59m` alone and the pin holds: the chart sends none of the three shapes #625 and #641 moved. `tests/cli.rs` asserts `termlens diff` says "rows unchanged", and a cursor move leaves more than one row alone, so #652's "1 row" does not reach it. The `report@` pin moves from v0.11.7 to v0.11.8 (61f597e, checked with `gh api`). The action now writes screens verbatim into the summary (termlens#648). It also takes `artifact-dir:` (termlens#654); the default, `$RUNNER_TEMP/termlens`, is the directory ci.yml already uses, so it is not passed. The vendored skill is recopied from v0.11.8; it was verbatim v0.11.7. Verified: `cargo test --all-features --no-fail-fast`, with and without COLORTERM, the art_cli leg under TZ=Pacific/Kiritimati, and `--test cli -- --ignored` against the published termlens-cli 0.11.8; fmt, clippy, docs, cargo-deny and `cargo +1.88 check --locked`. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- .claude/skills/termlens/SKILL.md | 29 +++++++++++++++++++++++------ .github/workflows/ci.yml | 2 +- Cargo.lock | 4 ++-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.claude/skills/termlens/SKILL.md b/.claude/skills/termlens/SKILL.md index 299bb76..3681082 100644 --- a/.claude/skills/termlens/SKILL.md +++ b/.claude/skills/termlens/SKILL.md @@ -5,7 +5,7 @@ description: Write, fix or review headless terminal tests for a Rust CLI or TUI # Testing terminal programs with termlens -Written against **termlens 0.11.7**. 0.11.0 is the stability candidate: +Written against **termlens 0.11.8**. 0.11.0 is the stability candidate: from it no promised public item changes incompatibly before 1.0, so the API below is one to build on, not one to expect to move. Every `rust` block below is a complete integration test that is compiled against the crate in CI, so @@ -122,9 +122,10 @@ your test ── send(Key) · click · paste · resize ──▶ PTY └─ 8. **`wait_frame` only works for applications that emit DEC 2026 synchronized updates.** Stock ratatui 0.30 with crossterm does **not** (measured: `repaints()` stays 0), so `wait_frame` times out against it - with a message saying exactly that, and `Terminal::record()` refuses - for the same reason. Default to `snapshot_after`. Use `wait_frame` only - if the application brackets its repaints in `BeginSynchronizedUpdate` / + with a message saying exactly that, and `record().stop()` refuses for + the same reason (`record()` itself cannot fail, so it takes no `?`). + Default to `snapshot_after`. Use `wait_frame` only if the application + brackets its repaints in `BeginSynchronizedUpdate` / `EndSynchronizedUpdate` — then a `wait_frame` timeout also shows the diff from the last frame it returned to the live screen. @@ -418,7 +419,7 @@ included in `X`, and `terminal closed (EOF) while waiting for X` is | `… note: the application queried the terminal (^[[?u …) and received no answer` | the app is blocked on a probe termlens deliberately does not answer | the app needs a fallback; see [the questions termlens leaves unanswered](https://github.com/vyncint/termlens/blob/main/docs/LIMITATIONS.md#waits-frames-and-queries) | | `terminal closed (EOF) while waiting for …` | the app exited before the predicate held | check `wait_exit()` first, or the app crashed — the final screen shows why | | ``failed to send Char('x') to `…` (the child is gone (exit code 7) and the terminal is closed)`` | input was sent after the child exited | check `wait_exit()` first and inspect the screen embedded under `--- screen at the failed write ---` | -| ``failed to send … to `…` (the application is not reading its input, and the PTY buffer is full — no progress in 5s; …)`` | the child is alive but has stopped draining terminal input; the unwritten bytes stay queued, so do not retry the send | wait for the application to draw the state that is ready for input before typing | +| ``failed to send … to `…` (the application is not reading its input, and the PTY buffer is full — a write into it was still blocked after 5s; …)`` | the child is alive but has stopped draining terminal input; the unwritten bytes stay queued, so do not retry the send | wait for the application to draw the state that is ready for input before typing | | `the application never emitted a DEC 2026 synchronized update` | `wait_frame` or `record().stop()` against an app without synchronized output | use `snapshot_after` / `wait_until` (rule 8) | | `--- last returned frame → live screen ---` under a `wait_frame` timeout | the app repainted, but never into the predicate | the diff shows what did change; the predicate is looking at the wrong thing | | `input not receivable: the application has not enabled mouse tracking` | `click`/`drag`/`scroll` before the app enabled the mouse | `wait_until(|s| s.mouse_mode() != MouseMode::None)` first | @@ -569,12 +570,28 @@ directory (see §9b). relative program path such as `./demo` is then found inside `DIR`. - In CI, set `TERMLENS_ARTIFACT_DIR: ${{ runner.temp }}/termlens` and `INSTA_UPDATE: new` on the test step, and add - `uses: vyncint/termlens/.github/actions/report@v0.11.7` with + `uses: vyncint/termlens/.github/actions/report@v0.11.8` with `if: failure()` after it: every screen a failing wait embedded, and every `.snap.new` with its diff, lands in the pull request's step summary. `INSTA_UPDATE: new` is not optional: insta's default writes no `.snap.new` when `CI` is set, and GitHub sets it on every runner. Inline snapshots are not rendered; insta keeps their new values in `.pending-snap` files. + Give the action `with: artifact-dir:` set to the same directory, because + a step's `env:` does not reach the next step, and in a matrix a + `name: termlens-report-${{ matrix.os }}` of its own per leg, because + upload-artifact refuses a second artifact of one name in a run: + + ```yaml + - run: cargo test + env: + TERMLENS_ARTIFACT_DIR: ${{ runner.temp }}/termlens + INSTA_UPDATE: new + - uses: vyncint/termlens/.github/actions/report@v0.11.8 + if: failure() + with: + artifact-dir: ${{ runner.temp }}/termlens + name: termlens-report-${{ matrix.os }} + ``` ## 10. A checklist before you finish diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc8ec96..2910c58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: # This renders every screen the suite left behind — and every insta # `.snap.new` — into the job summary, with SVG and HTML uploaded. It # installs termlens-cli itself, so nothing else here has to. - - uses: vyncint/termlens/.github/actions/report@ff50ffcdf91f3567e4f5b0c2056b8ee02e65c450 # v0.11.7 + - uses: vyncint/termlens/.github/actions/report@61f597e8447c295cccfcfcf43b2794d256db3841 # v0.11.8 if: failure() with: name: termlens-report-${{ matrix.os }} diff --git a/Cargo.lock b/Cargo.lock index a7ddbda..f7255c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1562,9 +1562,9 @@ dependencies = [ [[package]] name = "termlens" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceec406e2953f35eb0aeedb2bcf1129765bca4debdc1157c8b46ee8ae8dc5ca1" +checksum = "f94352dad7755856b35bc712589640abf707dbabb0da7fbe7e892a26643619b1" dependencies = [ "insta", "libc",