Scroll to navigation

App::Yath::Options::Runner(3pm) User Contributed Perl Documentation App::Yath::Options::Runner(3pm)

NAME

App::Yath::Options::Runner - Runner options for Yath.

DESCRIPTION

This is where command line options for the runner are defined.

PROVIDED OPTIONS

COMMAND OPTIONS

Runner Options

Abort all testing if a bail-out is encountered (default: on)
(Default: include if it exists) Include 'blib/lib' and 'blib/arch' in your module path
Use Devel::Cover to calculate test coverage. This disables forking. If no args are specified the following are used: -silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl
When using staged preload, dump the depmap for each stage as json files
Kill test if no output is received within timeout period. (Default: 60 seconds). Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis. This prevents a hung test from running forever.
Treat resource-skipped tests as failures instead of skips. When enabled, tests that would be skipped due to unavailable resources will be marked as failing.
Add a directory to your include paths

Can be specified multiple times

Set the number of concurrent jobs to run. Add a :# if you also wish to designate multiple slots per test. 8:2 means 8 slots, but each test gets 2 slots, so 4 tests run concurrently. Tests can find their concurrency assignment in the "T2_HARNESS_MY_JOB_CONCURRENCY" environment variable.

Can also be set with the following environment variables: "YATH_JOB_COUNT", "T2_HARNESS_JOB_COUNT", "HARNESS_JOB_COUNT"

(Default: include if it exists) Include 'lib' in your module path
Use Devel::NYTProf on tests. This will set addpid=1 for you. This works with or without fork.
Stop waiting post-exit after the timeout period. (Default: 15 seconds) Some tests fork and allow the parent to exit before writing all their output. If Test2::Harness detects an incomplete plan after the test exits it will monitor for more events until the timeout period. Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis.
Only do preload if at least N tests are going to be run. In some cases a full preload takes longer than simply running the tests, this lets you specify a minimum number of test jobs that will be run for preload to happen. This has no effect for a persistent runner. The default is 0, and it means always preload.
Preload a module before running tests

Can be specified multiple times

Abort the test run if no tests have been able to start for SECONDS seconds while there are pending tests and none running. This is useful when a resource class is broken and always claims a resource will become available, preventing yath from ever finishing. (Default: 0, meaning no timeout)
Use a resource module to assign resource assignments to individual tests

Can be specified multiple times

Runner ID (usually a generated uuid)
Where to look for a shared slot config file. If a filename with no path is provided yath will search the current and all parent directories for the name.
This sets the number of slots each job will use (default 1). This is normally set by the ':#' in '-j#:#'.

Can also be set with the following environment variables: "T2_HARNESS_JOB_CONCURRENCY"

Print diagnostics when the scheduler appears to have stopped starting tests. Give it alone for sensible waits, or set them: STRONG is the wait, in seconds, before reporting when tests are pending and none are running; LOOSE is the wait when tests are pending and others are still running. A single number sets both, and a zero in either field turns off that tier alone, so 600:0 reports only when nothing is running. This only prints a report, it never ends the run, and a report may be benign. Enabling it sends SIGUSR1 to yath's own processes to collect stack traces, pauses output for a few seconds per report, stops after 5 reports, and writes a yath-stall-report-*.json bundle both into the run log and to a file (see --stall-report-dir). (Default: off; --stall-report alone means 600:1200)
Directory for the JSON bundle --stall-report writes. Defaults to the directory yath was run from. Use this when that directory is not writable, or to collect bundles somewhere durable.
Pass the specified switch to perl for each test. This is not compatible with preload.

Can be specified multiple times

(Default: off) Include 't/lib' in your module path
perl is removing '.' from @INC as a security concern. This option keeps things from breaking for now.

Can also be set with the following environment variables: "PERL_USE_UNSAFE_INC"

(default: on, except on windows) Normally tests are run by forking, which allows for features like preloading. This will turn off the behavior globally (which is not compatible with preloading). This is slower, it is better to tag misbehaving tests with the '# HARNESS-NO-PRELOAD' comment in their header to disable forking only for those tests.

Can also be set with the following environment variables: "!T2_NO_FORK", "T2_HARNESS_FORK", "!T2_HARNESS_NO_FORK", "YATH_FORK", "!YATH_NO_FORK"

(default: on) Enable/disable timeouts

SOURCE

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

MAINTAINERS

AUTHORS

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/

2026-10-31 perl v5.42.3