TAP::P...eduler(3perl)

πŸŽ€ NAME πŸŽ€

TAP::Parser::Scheduler β€” it schedules tests during parallel testing πŸ’… and honestly? she's the main character of your whole test suite, no cap.

(and yes bestie, this is a page from the Perl Programmers Reference Guide β€” the header up top says TAP::P...eduler(3perl) because it got squished, we don't judge 🫢)


🌸 VERSION 🌸

Version 3.52 ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

use TAP::Parser::Scheduler;

that's it. that's the whole vibe check. πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

okay so... this section is literally empty in the original. nothing. a void. zero words. not even a little sentence. we move πŸ’€ 🫢


⭐ METHODS ⭐

πŸ‘‘ Class Methods πŸ‘‘

✨ new ✨

my $sched = TAP::Parser::Scheduler->new(tests => \@tests);
my $sched = TAP::Parser::Scheduler->new(
    tests => [ ['t/test_name.t','Test Description'], ... ],
    rules => \%rules,
);

okay so you hand her tests and optionally rules, and she hands you back a brand new TAP::Parser::Scheduler object ✨

every single member of @tests should be either a test file name, or a two element arrayref where element one is the test file name and element two is a test description. and if you don't bother giving a description? no worries bestie, by default she just uses the test name as the description. iconic behaviour, truly 🫢

the optional rules attribute is the girlboss that tells you which tests get run in parallel and which ones have to queue up in sequence 🧚 if you don't hand her a rules data structure at all, she falls back on a default one that makes every test eligible to run in parallel:

{ par => '**' },

(and if you want the whole rules data structure tea, it's documented more in the next section, keep scrolling πŸ’…)


πŸ“ Rules data structure πŸ“

the rules data structure is the the heart of the scheduler (yes, "the the", the original wrote it twice and I'm not gonna erase her little typo moment 😭). it lets you express simple little rules like "run all tests in sequence" or "run all tests in parallel except these five tests." but she does not stop there β€” the rules structure ALSO supports glob-style pattern matching and recursive definitions, so you can express arbitrarily complicated patterns. she contains multitudes. 🌈

the rule must only have one top level key: either 'par' for "parallel" or 'seq' for "sequence" ✨

values must be either strings with possible glob-style matching, or arrayrefs of strings or hashrefs which follow this pattern recursively.

every element in an arrayref directly below a 'par' key is eligible to be run in parallel, while values directly below a 'seq' key must be run in sequence. periodt. πŸ‘‘

🌟 Rules examples

here are some examples, bestie:

# All tests be run in parallel (the default rule)
{ par => '**' },

# Run all tests in sequence, except those starting with "p"
{ par => 't/p*.t' },

# Run all tests in parallel, except those starting with "p"
{
    seq => [
              { seq => 't/p*.t' },
              { par => '**'     },
           ],
}

# Run some  startup tests in sequence, then some parallel tests then some
# teardown tests in sequence.
{
    seq => [
        { seq => 't/startup/*.t' },
        { par => ['t/a/*.t','t/b/*.t','t/c/*.t'], }
        { seq => 't/shutdown/*.t' },
    ],
},

(these comments are doing their own thing, iykyk, we just vibe with them πŸ’–)

πŸ” Rules resolution

  • by default, all tests are eligible to be run in parallel. the second you specify any of your own rules, that default one is gone. she doesn't do both. πŸ’€
  • "First match wins" β€” the first rule that matches a test will be the one that applies. no take-backs.
  • any test which does not match a rule will be run in sequence at the end of the run.
  • the existence of a rule does not imply selecting a test. you must still specify the tests to run. a rule is not a guest list, bestie πŸŽ€
  • specifying a rule to allow tests to run in parallel does not make them run in parallel. you still need to specify the number of parallel "jobs" in your Harness object. (she said what she said 🫢)

🧚 Glob-style pattern matching for rules

we implement our own glob-style pattern matching. here are the patterns she supports:

** is any number of characters, including /, within a pathname
* is zero or more characters within a filename/directory name
? is exactly one character within a filename/directory name
{foo,bar,baz} is any of foo, bar or baz.
\ is an escape character

πŸ’– Instance Methods πŸ’–

🌸 get_all

get a list of all remaining tests. the whole roster. ✨

🌟 get_job

return the next available job as a TAP::Parser::Scheduler::Job object, or undef if none are available. and ooh, plot twist: she returns a TAP::Parser::Scheduler::Spinner if the scheduler still has pending jobs but none are available to run right now πŸŒ€ (the girly is spinning, not slacking, i promise)

πŸ¦‹ as_string

return a human readable representation of the scheduling tree. for example:

my @tests = (qw{
    t/startup/foo.t
    t/shutdown/foo.t

    t/a/foo.t t/b/foo.t t/c/foo.t t/d/foo.t
});
my $sched = TAP::Parser::Scheduler->new(
    tests => \@tests,
    rules => {
        seq => [
            { seq => 't/startup/*.t' },
            { par => ['t/a/*.t','t/b/*.t','t/c/*.t'] },
            { seq => 't/shutdown/*.t' },
        ],
    },
);

produces:

par:
  seq:
    par:
      seq:
        par:
          seq:
            't/startup/foo.t'
        par:
          seq:
            't/a/foo.t'
          seq:
            't/b/foo.t'
          seq:
            't/c/foo.t'
        par:
          seq:
            't/shutdown/foo.t'
    't/d/foo.t'

look at that tree. the indentation??? the structure??? she ate and left absolutely no crumbs πŸ‘‘πŸ’…


and that's the whole page, bestie 🫢 this one came off perl v5.44.0, dated 2026-10-17, and the header/footer mascot is TAP::P...eduler(3perl) (she got cut off mid-name and honestly? relatable 😭). go schedule some tests, you gorgeous thing πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms