Headless output modes: dense / standard / verbose (#10) #22

Open
orchestrator wants to merge 9 commits from wip/issue-10 into integration/wave2
Member

Per #10 (PR #1 comment 135).

  • output?: 'auto'|'dense'|'standard'|'verbose' (programmatic) + -o/--output, -q/--quiet, -v/--verbose.
  • auto = standard on a TTY else dense. Dense is silent on success. Standard is a single self-updating colored line (<TEST|PASS|FAIL> <file> <test-name>) truncated to width, tracking the running test via the data-* hooks. Verbose adds per-test sections + console/pageerror.
  • Colors only on a TTY without NO_COLOR; log contract preserved (a custom log with no output defaults to standard).

Verification

  • Per-mode local checks (pass/fail/timeout), TTY vs non-TTY, NO_COLOR, truncation; smoke covers all modes.

Closes #10

Base: integration/wave2 is the integration point this branch was based on, so this PR's diff shows only this issue's changes.

Per #10 (PR #1 comment 135). - `output?: 'auto'|'dense'|'standard'|'verbose'` (programmatic) + `-o/--output`, `-q/--quiet`, `-v/--verbose`. - `auto` = standard on a TTY else dense. Dense is silent on success. Standard is a single self-updating colored line (`<TEST|PASS|FAIL> <file> <test-name>`) truncated to width, tracking the running test via the `data-*` hooks. Verbose adds per-test sections + console/pageerror. - Colors only on a TTY without `NO_COLOR`; `log` contract preserved (a custom `log` with no `output` defaults to standard). ## Verification - Per-mode local checks (pass/fail/timeout), TTY vs non-TTY, `NO_COLOR`, truncation; smoke covers all modes. Closes #10 > **Base:** `integration/wave2` is the integration point this branch was based on, so this PR's diff shows **only this issue's changes**.
Pure, self-contained reporter used by the headless runner to render
progress in one of three modes:

  - dense    silent on success; failures + artifact paths only
  - standard a single self-updating <TEST|PASS|FAIL> <file> <name> line,
             rewritten in place and truncated to the terminal width
  - verbose  a colored section per test plus page diagnostics

`auto` resolves to `standard` on a TTY, else `dense`. ANSI SGR is only
emitted to a TTY without NO_COLOR; truncation keeps the line from
wrapping. The historical `log` line sink is preserved.
- Add the `output?: auto|dense|standard|verbose` programmatic option.
- Poll the runner's `data-*` hooks every 75ms while the suite runs,
  reporting each test transition (running/pass/fail) to the reporter;
  take a final snapshot so the settling test is included.
- Build a single RunReport for the end of the run; strict `--quiet`/dense
  success stays silent while failures keep their artifact paths.
- Keep `log` working as the line sink.
Precedence is explicit --output, then --verbose, then --quiet, else
auto. An unknown --output value exits 2 with usage. Help text updated.
Dense is the default in CI (non-TTY), so the existing PASS-output
assertions now request --verbose; add explicit mode checks (silent
success, no-ANSI standard, per-test verbose sections, dense failures).
A stuck page must not hang the polling loop or the final sweep, so race
page.evaluate with a 2s timeout (cleared when the evaluate settles).
Gives machine consumers (the headless runner) a DOM-stable per-test
identity; test ids are per-iframe, so callers scope the id by file.
P1: with a custom `log` sink and `auto` (the default), resolve to
`standard` so programmatic consumers keep getting progress + the PASS
summary. Explicit `output` still wins (dense + log stays silent).
- Startup info() lines now print only in `verbose`; standard is its
  single live line + summary.
- When color is off (non-TTY or NO_COLOR) the live line redraws with CR
  + padding, never an ANSI clear-line.
- README states exactly what each mode delivers to `log`.
- Key per-test state by file + data-test-id (name fallback) instead of
  the querySelectorAll snapshot ordinal; ids are per-iframe so the file
  prefix is required. Fixes the misleading ordinal comment.
- Skip the 75ms poller entirely in dense mode (no page.evaluate churn).
- Attach .catch to the poller immediately so a stdout EPIPE or teardown
  throw cannot surface as an unhandled rejection.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin wip/issue-10:wip/issue-10
git switch wip/issue-10

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch integration/wave2
git merge --no-ff wip/issue-10
git switch wip/issue-10
git rebase integration/wave2
git switch integration/wave2
git merge --ff-only wip/issue-10
git switch wip/issue-10
git rebase integration/wave2
git switch integration/wave2
git merge --no-ff wip/issue-10
git switch integration/wave2
git merge --squash wip/issue-10
git switch integration/wave2
git merge --ff-only wip/issue-10
git switch integration/wave2
git merge wip/issue-10
git push origin integration/wave2
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
legend/gooey-test!22
No description provided.