NAME

Test2::Harness::Stall::Report - Render and deliver a stall report.

DESCRIPTION

Turns a capture bundle into something a person and an analysis agent can both read, and puts it where both will find it.

Reports go to two places. The main process's STDERR is never redirected by yath, so it reaches the CI log directly, even if the event pipeline is itself unhealthy. aux_logs/stall-STDERR.log is picked up by Test2::Harness::Collector, which re-reads that directory on every poll and tags anything ending -STDERR.log as debug output, so it reaches the yath UI with no new plumbing.

The runner's error.log is deliberately not used: it is opened without append, so a second writer and the runner would overwrite each other.

The full bundle is also written as JSON, twice. Once to the aux log as a single physical line, so it reaches the yath UI as one info facet and can be pulled back out later. Once to a file, outside the working directory, because for a plain yath test that directory is temporary and is removed when the run ends; that copy goes to the directory yath was run from unless --stall-report-dir says otherwise. The text report is a reduced view; open files, locks, the process tree and strace output live only in the JSON. Begin and end markers let the text be extracted from a log by pattern.

SYNOPSIS

use Test2::Harness::Stall::Report;

my $report = Test2::Harness::Stall::Report->new(
    workdir => $workdir,
    run_id  => $run_id,
);

$bundle->{state_summary} = $report->state_summary($state, $tasks);
$report->emit($bundle);

ATTRIBUTES

$string = $report->workdir()

The run's working directory, used for the aux log.

$string = $report->run_id()

Names the JSON bundle, so bundles from different runs can sit together.

$string = $report->report_dir()

Where the JSON bundle is written. Defaults to the directory yath was run from.

PUBLIC METHODS

$hashref = $report->state_summary($state, $tasks)

What the run looked like, taken from the replay rather than any live harness object.

$string = $report->render($bundle)

The human-readable report, between begin and end markers.

$string = $report->emit($bundle)

Renders, writes to both channels and the JSON bundle, and returns the text.

$string = $report->headline($bundle)

One line saying what was observed.

$string = $report->task_lines($label, $tasks)

A bounded list of tests; the full list is in the JSON.

$string = $report->json_file($round)

Where the bundle for a given report is written.

$string = $report->aux_file()

The aux log the collector forwards.

SOURCE

The source code repository for Test2-Harness can be found at https://github.com/Test-More/Test2-Harness/.

MAINTAINERS

Chad Granum <exodist7@gmail.com>

AUTHORS

Chad Granum <exodist7@gmail.com>

COPYRIGHT

Copyright Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See https://dev.perl.org/licenses/