.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test2::Harness::Event 3pm" .TH Test2::Harness::Event 3pm "2023-03-12" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test2::Harness::Event \- Subclass of Test2::Event used by Test2::Harness under the hood. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Test2 tests produce a sequence of events objects Test2::Event. This is a subclass of those events for use in Test2::Harness. Event non-test tests which produce \s-1TAP\s0 output will have the output parsed into these types of events. .SH "SYNOPSIS" .IX Header "SYNOPSIS" In normal usage ou will never need to create one fo these events yourself. This documentation assumes you are operating on an existing event \f(CW$event\fR that the harness exposed to you via a plugin or similar. .PP .Vb 5 \& my $facet_data = $event\->facet_data; \& my $run_id = $event\->run_id; \& my $job_id = $event\->job_id; \& my $job_try = $event\->job_try; \& my $event_id = $event\->event_id; .Ve .SH "METHODS" .IX Header "METHODS" See Test2::Event for methods provided by the base class. .ie n .IP "$hashref = $event\->\s-1TO_JSON\s0" 4 .el .IP "\f(CW$hashref\fR = \f(CW$event\fR\->\s-1TO_JSON\s0" 4 .IX Item "$hashref = $event->TO_JSON" Used for json serialization. .ie n .IP "$json_string = $event\->as_json" 4 .el .IP "\f(CW$json_string\fR = \f(CW$event\fR\->as_json" 4 .IX Item "$json_string = $event->as_json" This will return a json representation of the event. Note that this is a lossy conversion with some harness specific state removed by design. This may even be a cached copy of the json string that was decoded to produce the original object. If the string was not cached before it will be cached for all future calls ignoring any state change to the event. .Sp The lossy/cached conversion is intended so that events get passed through the harness pipeline without modifications from one step translating to another. If you need something extra to go through you need to either replace the event or create an additional one. .ie n .IP "$string = $event\->event_id" 4 .el .IP "\f(CW$string\fR = \f(CW$event\fR\->event_id" 4 .IX Item "$string = $event->event_id" Usually a \s-1UUID,\s0 but not always! .ie n .IP "i$hashref = $event\->facet_data" 4 .el .IP "i$hashref = \f(CW$event\fR\->facet_data" 4 .IX Item "i$hashref = $event->facet_data" Get the event facet data, this is the meat of the event that hold all the state. .ie n .IP "$string = $event\->job_id" 4 .el .IP "\f(CW$string\fR = \f(CW$event\fR\->job_id" 4 .IX Item "$string = $event->job_id" Usually a \s-1UUID,\s0 but not always! .ie n .IP "$int = $event\->job_try" 4 .el .IP "\f(CW$int\fR = \f(CW$event\fR\->job_try" 4 .IX Item "$int = $event->job_try" Integer, 0 or greater. Some jobs are run additional times if they fail, this says which attempt the event is for. The counter starts at 0. .ie n .IP "$bool = $event\->processed" 4 .el .IP "\f(CW$bool\fR = \f(CW$event\fR\->processed" 4 .IX Item "$bool = $event->processed" This will be true if the event has been process by the harness. Note that this attibute is not serialized by \f(CW\*(C`TO_JSON\*(C'\fR or \f(CW\*(C`as_json\*(C'\fR. .ie n .IP "$string = $event\->run_id" 4 .el .IP "\f(CW$string\fR = \f(CW$event\fR\->run_id" 4 .IX Item "$string = $event->run_id" The run id. This is usually a \s-1UUID,\s0 but not always! .ie n .IP "$ts = $event\->stamp" 4 .el .IP "\f(CW$ts\fR = \f(CW$event\fR\->stamp" 4 .IX Item "$ts = $event->stamp" A unix timestamp for when the event was created. .ie n .IP "$id = $event\->stream_id" 4 .el .IP "\f(CW$id\fR = \f(CW$event\fR\->stream_id" 4 .IX Item "$id = $event->stream_id" This is an implementation detail of Test2::Formatter::Stream, do not rely on it. This is used to prevent parsing errors when stream output is nested in other stream output, which can happen if you are writing tests for the stream formatter itself. .ie n .IP "$trace = $event\->trace" 4 .el .IP "\f(CW$trace\fR = \f(CW$event\fR\->trace" 4 .IX Item "$trace = $event->trace" This si a shortcut for \f(CW\*(C`$event\->facet_data\->{trace}\*(C'\fR. The trace data is essential and used everywhere. .SH "SOURCE" .IX Header "SOURCE" The source code repository for Test2\-Harness can be found at \&\fIhttp://github.com/Test\-More/Test2\-Harness/\fR. .SH "MAINTAINERS" .IX Header "MAINTAINERS" .IP "Chad Granum " 4 .IX Item "Chad Granum " .SH "AUTHORS" .IX Header "AUTHORS" .PD 0 .IP "Chad Granum " 4 .IX Item "Chad Granum " .PD .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2020 Chad Granum . .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See \fIhttp://dev.perl.org/licenses/\fR