Skip to content

fix(cli): keep inspect's expected errors out of the artifact dir - #611

Merged
vyncint merged 2 commits into
mainfrom
fix/inspect-artifacts
Oct 27, 2026
Merged

vyncint merged 2 commits into
mainfrom
fix/inspect-artifacts

Conversation

@vyncint

@vyncint vyncint commented Oct 27, 2026

Copy link
Copy Markdown
Owner

termlens inspect uses the library's errors as outcomes — Eof for a program that exits without painting, Timeout for one still running at the deadline — and the library writes every screen-carrying error to TERMLENS_ARTIFACT_DIR. So inspect true (exit 0) left main-1.screen.json there, which the report action then lists under "screens from the failing tests".

Fix. The CLI and the inspect example take the variable out of their own environment at the top of inspect, before any thread exists (edition 2021, so remove_var is safe there), and hand it explicitly to the program when it runs with --inherit-env, so a program that wants it still sees it.

Library half. As the issue says, a per-wait opt-out needs a design decision first; this documents the behaviour instead: Error's TERMLENS_ARTIFACT_DIR section now says an expected timeout or EOF is recorded too, so the variable belongs on the steps whose failures you want to see.

Test. inspect true and a program still running at --timeout 1 leave the directory empty, and a --inherit-env program sees the variable. With the remove_var line removed the test fails with exactly the issue's ["main-1.screen.json"].

Closes #596

inspect takes the library's Eof and Timeout as outcomes, and the library
records every error that carries a screen in TERMLENS_ARTIFACT_DIR, so a
normal run left a failure screen there. The CLI and the inspect example
take the variable out of their own environment before any thread exists,
and hand it to the program when it inherits the environment. The
library documents that an expected error is recorded too (#596).

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
Resolves the CHANGELOG conflict with #610: both sets of entries kept.

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
@vyncint
vyncint merged commit 9842ec1 into main Oct 27, 2026
16 checks passed
@vyncint
vyncint deleted the fix/inspect-artifacts branch October 27, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

termlens inspect leaves failure screens in TERMLENS_ARTIFACT_DIR on success

1 participant