The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::BrewBuild::Dispatch - Dispatch Test::BrewBuild test runs to remote test servers.

SYNOPSIS

    use Test::BrewBuild::Dispatch;

    my $d = Test::BrewBuild::Dispatch->new;

    my $return = $d->dispatch(
        cmd => 'brewbuild -r -R',
        testers => [qw(127.0.0.1 10.1.1.1:9999)],
        repo => 'https://github.com/user/repo',
    );

    print $return;

DESCRIPTION

This is the remote dispatching system of Test::BrewBuild.

It dispatches out test runs to Test::BrewBuild::Tester remote test servers to perform, then processes the results returned from those testers.

By default, we try to look up the repository information from your current working directory. If it can't be found, you must supply it on the command line or within the configuration file.

METHODS

new

Returns a new Test::BrewBuild::Dispatch object.

dispatch(cmd => '', repo => '', testers => ['', ''], debug => 0-7)

cmd is the brewbuild command string that will be executed.

repo is the name of the repo to test against, and is optional. If not supplied, we'll attempt to get a repo name from the local working directory you're working in. If it's a Github repo, you need not enter in the full path... we'll prepend https://github.com/ if you send in user/repo-name.

testers is manadory unless you've set up a config file, and contains an array reference of IP/Port pairs for remote testers to dispatch to and follow. eg: [qw(10.1.1.5 172.16.5.5:9999)]. If the port portion of the tester is omitted, we'll default to 7800.

By default, the testers run on all IPs and port TCP/7800.

debug optional, set to a level between 0 and 7.

See Test::BrewBuild::Tester for more details on the testers that the dispatcher dispatches to.

auto(%params)

This function will spin off a continuous run of dispatch() runs, based on whether the commit revision checksum locally is different than that from the remote. It takes all of the same parameters as dispatch(), and the -r|--repo parameter is mandatory.

There is also a configuration file directive in the [Dispatch] section, auto_sleep, which dictates how many seconds to sleep in between each run. The default is 60, or one minute.

AUTHOR

Steve Bertrand, <steveb at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2017 Steve Bertrand.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.