Test2::Harness::Log(3pm) | User Contributed Perl Documentation | Test2::Harness::Log(3pm) |
Test2::Harness::Log - Documentation about the Test2::Harness log file.
Test2::Harness aka App::Yath produces a rich/complete log when asked to do so. This module documents the log format.
Test2::Harness can output log files uncompressed, compressed in gzip, or compressed in bzip2.
The log file is in jsonl format. Each line of the log can be indepentantly parsed as json. Each line represents a single event Test2::Harness processed during a run. These events will be in the original order Test2::Harness processed them in (may not be chronological to when they were generated as generation, collection, processing, and rendering are handled in different processes. A complete log will be terminated by the string "null", which is also valid json. If a log is missing this terminator it is considered an incomplete log.
Please note: Older versions of Test2::Harness produced less complete events, this covers all current fields, if you are attempting to handle very old logs some of these fields may be missing.
Each event will have the following fields:
{ "event_id" : "CD01CD30-D535-11EA-9B6A-D90F9664FE12", "job_id" : 0, "job_try" : null, "run_id" : "CCF98E54-D535-11EA-915A-D70F9664FE12", "stamp" : 1596423763.76517, "facet_data" : { "harness" : { "event_id" : "CD01CD30-D535-11EA-9B6A-D90F9664FE12", "job_id" : 0, "job_try" : null, "run_id" : "CCF98E54-D535-11EA-915A-D70F9664FE12" }, ... } }
In addition to the original facets of the event, Test2::Harness may inject the following facets (or generate completely new events to convey these facets).
{ # Was the test run a success, or were there failures? pass => $BOOL, # What tests failed? failed => [ [ $job_id, # Job id of the job that failed $file, # Test filename ], ... ], # What tests had to be retried, and did they eventually pass? retried => [ [ $job_id, # Job id of the job that was retied $tries, # Number of tries attempted $file, # Test filename $eventually_passed, # 'YES' if it eventually passed, 'NO' if no try ever passed. ], ... ], # What tests setn a halt event (such as bail-out, or skip the rest) halted => [ [ $job_id, # Job id of the test $file, # Test filename $halt, # Halt code ], ... ], # What tests were never run (maybe because of a bail-out, or an internal error) unseen => [ [ $job_id, # Job id of the test $file, # Test filename ], ... ], }
Note: This is done via a transformation, several methods have their values stored in this hash when the original object does not directly store them.
{ file => $provided_path_to_test_file, rel_file => $relative_path_to_test_file, abs_file => $absolute_path_to_test_file, fail => $BOOL, retry => $INTEGER, # Number of retries left stamp => $UNIX_TIMESTAMP, # Timestamp of when the test completed # May not be present skip => $STRING, # Reason test was skipped (if it was skipped) times => $TIMING_DATA, # See below }
The "times" field is populated by calling "data_dump()" on an Test2::Harness::Auditor::TimeTracker Object.
{ exit => $WSTAT, retry => $INTEGER stamp => $UNIX_TIMESTAMP }
{ stamp => $UNIX_TIMESTAMP, rety => $INTEGER, }
This contains the data about a test job conveyed by the queue. This usually contains data that will later be used by Test2::Harness::Runner::Job. It is better to use the "harness_job" facet, which contains the final data used to run the job.
The following 3 fields are the only ones likely to be useful to most people:
{ file => $ORIGINAL_PATH_TO_FILE, job_id => $UUID_OR_STRING, stamp => $UNIX_TIMESTAMP, }
{ file => $provided_path_to_test_file, rel_file => $relative_path_to_test_file, abs_file => $absolute_path_to_test_file, stamp => $UNIX_TIMESTAMP, # Timestamp of when the test completed job_id => $UUID_OR_STRING, details => "Job UUID_OR_STRING started at $UNIX_TIMESTAMP", }
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
Copyright 2020 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 http://dev.perl.org/licenses/
2023-10-04 | perl v5.36.0 |