Test2:...er::Job(3pm)

πŸ’– NAME πŸ’–

Test2::Harness::Runner::Job β€” literally the whole representation of a test job, bestie. It's a Perl module, and yeah, the manual page is Test2:...er::Job(3pm) (iconic name, we don't question it).


✨ DESCRIPTION ✨

Okay so picture this: a test file queue item walks in πŸšΆβ™€οΈ, a run walks in 🚢, and runner settings walk in 🚢. This module takes alllll of that data and mashes it together β€” like, fully blends it β€” just to figure out what is actually needed to run a job. That's the whole gig. No cap. πŸ’…


πŸŽ€ METHODS πŸŽ€

Heads up bestie: this object subclasses Test2::Harness::IPC::Process. So some of the energy comes from up the family tree, iykyk. 🌳
  • $arrayref = $job->args β€” grab the arguments for the test 🌸 either from the queue item, or from the run.
  • $path = $job->bail_file β€” path to the events-file that gets used in case of a bail-out 😭
  • $bool = $job->bailed_out β€” true if the test job bailed out πŸ’€
  • $cat $job->category β€” the process category, always 'job' unless a subclass goes rogue and overrides it πŸ‘‘
  • $path = $job->ch_dir β€” if this job first needs a change of directory before it runs, this hands you the path πŸ“‚
  • @list = $job->cli_includes β€” the list of includes for a command line launch of this job ✨
  • @list = $job->cli_options β€” the list of options for a command line launch of this job πŸ’…
  • $hashref = $job->env_vars β€” get the environment variables to set when launching this job 🌈
  • $path = $job->out_file β€” the file where all STDOUT for the job gets written πŸ“
  • $path = $job->err_file β€” the file where all STDERR for the job gets written 🫣
  • $path = $job->et_file β€” the file where event timeout notifications get written ⏰
  • $path = $job->pet_file β€” the file where post exit timeout events get written 🐾
  • $path = $job->event_dir β€” the directory where Test2::Formatter::Stream events get written πŸ“
  • $time = $job->event_timeout β€” the event timeout specification, if there even is one: first from the test queue item, then from the runner ⏳
  • $time = $job->post_exit_timeout β€” the post exit timeout specification, if any: first from the test queue item, then from the runner ⏳
  • $bool = $job->event_uuids β€” use Test2::Plugin::UUID inside the test πŸ”–
  • $path = $job->file β€” the test file this job will be running πŸƒβ™€οΈ
  • $coderef = $job->fork_callback β€” if the job is gonna be launched via fork, use this callback 🍴
  • $path = $job->in_file β€” the file containing the 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 gets incremented for every retry of the job πŸ”
  • $path = $job->job_dir β€” the temporary directory housing all the files related to this job while it runs 🏠
  • $uuid = $job->job_id β€” the 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 β€” the 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 β€” the 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. If the task has a "resource_skip" set (which means permanently unavailable resources 😡), the command will emit TAP to skip the test. And when the "--fail-on-resource-skip" runner option is enabled, the command will instead emit a TAP test failure πŸ’₯
  • @list = $job->switches β€” the command line switches for perl when running this test πŸͺ
  • $hashref = $job->task β€” task data from the queue πŸ“‹
  • $path = $job->tmp_dir β€” the 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/. Go be nosy bestie, it's public 🫢


πŸ‘‘ MAINTAINERS πŸ‘‘

Chad Granum <exodist@cpan.org>


πŸ’œ AUTHORS πŸ’œ

Chad Granum <exodist@cpan.org>


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/


and that's the whole page, periodt πŸ’…βœ¨ this was perl v5.40.1, dated 2026-05-10, from the Test2:...er::Job(3pm) manual β€” thanks for reading bestie, ily, go write some tests πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from