Skip to content

Stream docs-journeys results and show failures clearly - #4808

Merged
Mpdreamz merged 8 commits into
mainfrom
docs/builder-help-me-improve
Nov 11, 2026
Merged

Mpdreamz merged 8 commits into
mainfrom
docs/builder-help-me-improve

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

docs-journeys run now prints each journey as it finishes, collapses repeated skips, and ends with a failure block in the same shape Nullean.Snapshots uses under TUnit.

Affects: Internals only

Prompt summary: Improve the developer experience of running the browser journeys against live sites. A run printed nothing until every journey had finished, 18 of its lines were one repeated skip reason, and a failure pointed at a temporary folder. Failures and errors should read as clearly as the Nullean.Snapshots ones, whether they come from TUnit, snap or docs-journeys.

Why

docs-journeys run --url https://docs-demo.elastic.dev waited for Task.WhenAll before it wrote anything. Against demo it then listed 18 skips for the same reason, and the one failure showed a path under /var/folders/.../docs-journeys-XXXX/ with no way to rerun it. Running one journey meant a nine-line cdp run command whose allow list was missing the global-nav host.

What

Results stream while the run is going

Each journey prints when it ends. On a terminal, a status line at the bottom shows the running journeys and their current step. In CI or a pipe the output is plain lines with no ANSI codes, and the existing ok, FAILED and skipped lines keep their format.

Repeated skips collapse

A reason shared by more than three journeys is shown once with a count, such as skipped 18 journeys (requires build-type:isolated). --verbose lists them. JUnit and the step summary still list every skipped journey.

Failures read like snapshot failures

After the results, each failure shows Journey stopped at <path>:<line>: <command>, the error as written, the last page checked, and a Rerun: line with the --only command. The path is the file in the checkout, even for a journey compiled into the binary. Bad input, such as an unknown --only id, is one Error: line and exit code 1 instead of a stack trace.

A shorter way to run a live site

--url accepts prod, edge, demo and local, --only area/name selects journeys by id, and mise run journeys:live demo wraps both. The docs replace the long cdp run recipe with these and keep a corrected one for debugging a single file.

The four ways to run journeys are told apart

The mise task descriptions say which runner each starts and whether it compares transcripts. The skipped live journeys in the TUnit run point to mise run journeys:live and no longer to a cdp run recipe, and docs/development/journeys.md has a table of TUnit, journeys:live, snap journey run and cdp run. The build warnings that printed before every TUnit run are fixed (SnapshotScrubbing regexes, a culture-sensitive Append, a Unix file mode call), except TUnit0001, which comes from the snapshots package and is suppressed for the journey tests with a note.

Verify

mise run journeys:live demo
mise run journeys:live prod --only navigation/main-paths
mise run journeys -- --treenode-filter "/*/*/DocsJourneysCliTests/*"

The native AOT publish (dotnet publish src/tooling/docs-journeys -c release) has no warnings. Setting CollapseAbove to 100 makes Run_ManyJourneysSkippedForOneReason_CollapsesThemUnlessVerbose fail.

Out of scope: the page URL and a screenshot on failure need Nullean.Cdp to record them, so they follow in a later PR after a cdp release.

🤖 Generated with Claude Code

A run now prints each journey as it finishes, with a status line of the running ones on a terminal. A reason that more than three journeys share is shown once with a count, and `--verbose` lists them. A failure is repeated last, in the shape `Nullean.Snapshots` uses under TUnit: the step, the error as written, the page, and a `Rerun:` line. Bad input is one `Error:` line, not a stack trace.

`--url` takes `prod`, `edge`, `demo` and `local`, `--only` runs journeys by id, and `mise run journeys:live` wraps both.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner November 10, 2026 17:56
@Mpdreamz
Mpdreamz requested a review from technige November 10, 2026 17:56
Mpdreamz and others added 2 commits November 10, 2026 19:01
… streaming

The rerun line now carries --journeys, --env, --build-type and --feature so
copying it reproduces the run. DrawStatus clears the old status line first, and
Finished no longer redraws twice. A new test reads a fast journey's result while
a slow one is still running.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ntext

On a terminal, a failure shows the journey's lines around the failing one, the error wrapped to the window, the page the journey last opened and the rerun command. The run's context is one labelled row per fact, with the site address and any probe notes. Step updates redraw the status line at most ten times a second.

CI and piped output keep the compact `context:` line and the `Journey stopped at` shape.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment on lines +247 to +250
if (!force && _sinceDraw.Elapsed < StatusInterval)
{
Defer();
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Add a regression test for the deferred interactive redraw. The CLI tests redirect stdout, so interactive is false and this branch never runs; removing Defer() would leave them green while restoring the stale-step display. Exercise a step arriving within the throttle interval and verify that it is eventually displayed without another step event, and that finishing the journey prevents a pending redraw from writing afterward.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

The run opens with a lead-in and an indented context with coloured values. Skips are blue with space around them, and results and totals carry icons, with `FAILED` in bold red. Icons fall back to ASCII when the locale is not UTF-8, and `NO_COLOR` drops the colour. The version only shows once builds are stamped.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

…them

The mise task descriptions now say which runner they start and what it compares. The skipped live journeys point to `mise run journeys:live` instead of a `cdp run` recipe, and the docs get a table of the four ways to run journeys. The three regexes in `SnapshotScrubbing`, the `StringBuilder.Append` in the fake site and the Unix file mode call no longer warn, and `TUnit0001` is suppressed for the journey tests because it comes from the snapshots package.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…improve

# Conflicts:
#	tests/Elastic.Documentation.Journeys.Tests/DocsJourneysExportTests.cs
#	tests/Elastic.Documentation.Journeys.Tests/Elastic.Documentation.Journeys.Tests.csproj
Comment thread mise.toml
arg "[site]" default="demo" help="prod, edge, demo or local"
arg "[args]..." var=#true help="Passed to docs-journeys run"
'''
run = "dotnet run --project src/tooling/docs-journeys -- run --url ${usage_site} --journeys tests/Elastic.Documentation.Journeys.Tests/journeys ${usage_args}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Preserve argument boundaries when forwarding the live task's extra arguments. Expanding ${usage_args} as an unquoted shell scalar loses empty arguments and splits values containing whitespace. For example, --feature "", which the CLI supports for disabling detected features, cannot reach the runner intact through this task. Forward the original argument vector without shell word-splitting or glob expansion.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

{
var command = rerun.Replace("{id}", outcome.File.Id, StringComparison.Ordinal);
_ = text.AppendLine().Append(
interactive ? PrettyFailure(outcome, journeysRoot, command) : FailureBlock(outcome, journeysRoot, command)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Add automated coverage for the interactive reporter branch. Every CLI test helper redirects standard output, so UseInteractive is always false: the new context block, source excerpts, terminal failure rendering and status-line redraw/cleanup are never exercised. Reporter-level tests with interactive mode enabled should cover a failure and concurrent journeys finishing, rather than leaving the terminal-specific behavior outside the regression suite.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

The fast journey's result took 17.8 s on a CI runner against a 12 s limit, because dotnet start-up and the Chrome launch were slow there. The slow journey now times out at 90 s and the limit is 60 s. The test kills the process once the fast result is seen, so the margin costs no time.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit 2f865cf into main Nov 11, 2026
42 checks passed
@Mpdreamz
Mpdreamz deleted the docs/builder-help-me-improve branch November 11, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant