---
name: "Test2::Harness::Runner::Job"
section: "3pm"
platform: "linux"
package: "libtest2-harness-perl"
version: "1.000158-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test2::Harness::Runner::Job"
---

# Test2::Harness::Runner::Job(3pm)

Representation of a test job.

## NAME

Test2::Harness::Runner::Job - Representation of a test job.

## DESCRIPTION

This module takes all the data from a test file queue item, a run, and runner settings, and mashes them together to figure out what is actually needed to run a job.

## METHODS

Note, this object subclasses Test2::Harness::IPC::Process.

- $arrayref = $job-\>args

  Get the arguments for the test either formt he queue item, or from the run.

- $path = $job-\>bail\_file

  Path to the events-file used in case of a bail-out

- $bool = $job-\>bailed\_out

  True if the test job bailed out.

- $cat $job-\>category

  Process category, always 'job' unless overriden in a subclass.

- $path = $job-\>ch\_dir

  If this job first requires a change in directory before running, this will return the path.

- @list = $job-\>cli\_includes

  List of includes for a command line launch of this job.

- @list = $job-\>cli\_options

  List of options for a command line launch of this job.

- $hashref = $job-\>env\_vars

  Get environment variables to set when launching this job.

- $path = $job-\>out\_file

  File to which all STDOUT for the job will be written.

- $path = $job-\>err\_file

  File to which all STDERR for the job will be written.

- $path = $job-\>et\_file

  File to which event timeout notifications will be written.

- $path = $job-\>pet\_file

  File to which post exit timeout events will be written.

- $path = $job-\>event\_dir

  Directory to which Test2::Formatter::Stream events will be written.

- $time = $job-\>event\_timeout

  Event timeout specification, if any, first from test queue item, then from runner.

- $time = $job-\>post\_exit\_timeout

  Post exit timeout specification, if any, first from test queue item, then from runner.

- $bool = $job-\>event\_uuids

  Use Test2::Plugin::UUID inside the test.

- $path = $job-\>file

  Test file the job will be running.

- $coderef = $job-\>fork\_callback

  If the job is to be launched via fork, use this callback.

- $path = $job-\>in\_file

  File containing STDIN to be provided to the test.

- @list = $job-\>includes

  Paths to add to `@INC` for the test.

- $bool = $job-\>io\_events

  True if Test2::Plugin::IOEvents should be used.

- $int = $job-\>is\_try

  This starts at 0 and will be incremented for every retry of the job.

- $path = $job-\>job\_dir

  Temporary directory housing all files related to this job when it runs.

- $uuid = $job-\>job\_id

  UUID for this job.

- @list = $job-\>load

  Modules to load when starting this job.

- @list = $job-\>load\_import

  Modules to load and import when starting this job.

- $bool = $job-\>mem\_usage

  True if the Test2::Plugin::MemUsage plugin should be used.

- $path = $job-\>run\_file

  Usually the same as rel\_file, but you can specify an alternative file to actually run.

- $path = $job-\>rel\_file

  Relative path to the file.

- $int = $job-\>retry

  How many times the test should be retried if it fails.

- $bool = $job-\>retry\_isolated

  True if the test should be retried in isolation if it fails.

- $run = $job-\>run

  The Test2::Harness::Runner::Run instance.

- $path = $job-\>run\_dir

  Path to the temporary directory housing all the data about the run.

- $runner = $job-\>runner

  The Test2::Harness::Runner instance.

- @list = $job-\>runner\_includes

  Search path includes provided directly by the runner.

- $settings = $job-\>settings

  The Test2::Harness::Settings instance.

- $bool = $job-\>smoke

  True if the test is a priority smoke test.

- $hashref = $job-\>spawn\_params

  Parameters for `run_cmd()` in Test2::Harness::Util::IPC when launching this job.

- @list = $job-\>switches

  Command line switches for perl when running this test.

- $hashref = $job-\>task

  Task data from the queue.

- $path = $job-\>tmp\_dir

  Temp dir created specifically for this job.

- $bool = $job-\>unsafe\_inc

  True if '.' should be added to `@INC`.

- $bool = $job-\>use\_fork

  True if this job should be launched via fork.

- $bool = $job-\>use\_stream

  True if this job should use Test2::Formatter::Stream.

- $bool = $job-\>use\_timeout

  True if this job should timeout due to lack of activity.

- $bool = $job-\>use\_w\_switch

  True if the `"-w"` switch should be used for this test.

## SOURCE

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

## MAINTAINERS

- Chad Granum \<exodist@cpan.org\>

  ## AUTHORS

- Chad Granum \<exodist@cpan.org\>

  ## COPYRIGHT

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/*
