Log

Event Log

The event log is a jsonl file containing every event the harness saw.

The log can be output in a compressed form using gzip or bzip2 (-G or -B flags)

The event log is a lossless format that will let you completely replay a test run (or parts of it) without actually re-running your tests.

The event log has Test2 events, with all their context data, in most cases there was no TAP conversion involved.

stdout/stderr exit codes, and all other data the harness collects are placed into events in the log.

There are several tools to process logs and provide useful metrics or summarize results.

Example

Example

Here is an example test run which will be used to demonstrate the next several tools:
Replay

Replay

This command lets you replay a run from a log. This will not actually re-run the tests, it will just re-render it. You can provide alternate rendering options to make it easier to read. You can also provide a list of jobs to show, others will be hidden.

Here we ask it to only output from one of the failures.

Now we will ask it for the verbose version of the output

Failed

Failed



The 'failed' command is a simple way to get a list of what test files failed in a given test log:
Times

Times

This command lets you see how long each test took. It also breaks the timing down to different stages.

Total
Total time taken
Startup
Time between test executing and first event seen
Events
Total time between the first and last events seen
Cleanup
Total time between the last event seen and the process exiting
You can also provide a custom sort order:
UI

UI

This command requires a seperate module: Test2::Harness::UI

This command will load a log file into a PostgreSQL database and launch a web-app that lets you view the run in detail.

Assuming you are watching this presentation and not simply reading my slides, I will now demonstrate the command.

For anyone reading the slides, here is a screenshot for your trouble: