The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::ape::plan - plan testing using elasticsearch

VERSION

version 0.001

USAGE

ape plan --version blahblah --platform something -- test1 test2 test3...testN

Will create a test plan and store it in elasticsearch, supposing one does not already exist for the passed version. Will also queue tests if a non-default Queue module is configured in elastest.conf.

In the event a plan matching your platform(s) and version is found, tests passed but not found in the plan will be added. Similarly, tests found in the plan but not passed will be removed.

If no platform(s) are provided, the configured (or default) platformer class will be used.

The basename of the tests passed will be used to identify 'what tests need to be run', so be sure to name your tests uniquely.

Tests passed which cannot be found will be ignored. If no tests are passed, any tests in t/ will be used by default.

optional switches

--show - display the proposed plan instead of creating it, and whether or not it already exists (or will be modified by passed arguments). If the plan already exists, the execution status of the relevant tests will also be displayed.
--prompt - display proposed modifications to a plan (if any) will be made on the server.
--pairwise - If configured with platform groups (see below), consider the plan satisfied if each platform passed appears at least once. In the event that a plan update is made, tests will be properly apportioned upon update.
--all-platforms - If configured with platform groups, use all those available rather than passing manually with --platform.
--name - If you want to differentiate your run from others with the same versions/platforms, use this.
--recurse - if passing directories of tests, recurse past the first level to find tests.
--extension - If passing directories, check for tests with these extensions. May be passed multiple times, defaults to t
--requeue - Re-queue an existing plan, in case something didn't quite work out. Use to suppress prompts about re-queueing in --prompt mode.
--replay - Dump the body of the test(s) associated when in --show mode. Filter the tests displayed by passing test names.

CONFIGURATION

Aside from the usual configuration from App::Prove::Plugin::Elasticsearch, you can add a new section to describe mutually exclusive platforms (combinations, for my fellow math geeks out there).

It would look something like this:

    [PlatformGroups]
    Operating Systems = CentOS 7 64-bit,CentOS 6 32-bit
    Browsers = Firefox,Chrome
    Interpreters = Perl 5.14,Perl 5.16

And result in plans specifying multiple platforms within the same group requiring the test be run at least once on all said platforms. For example, a plan created asking for all the above platforms would result in the following 8 runs being needed (2^3):

CentOS 7 64-bit on Firefox using Perl 5.14
CentOS 7 64-bit on Firefox using Perl 5.16
CentOS 6 64-bit on Firefox using Perl 5.14
CentOS 6 64-bit on Firefox using Perl 5.16
CentOS 7 64-bit on Chrome using Perl 5.14
CentOS 7 64-bit on Chrome using Perl 5.16
CentOS 6 64-bit on Chrome using Perl 5.14
CentOS 6 64-bit on Chrome using Perl 5.16

In general, the number of runs you will be required to execute to satisfy the plan will be $num_groups_represented * $num_groups_provided.

PAIRWISE TESTING

Were you to pass --pairwise, we would randomly mix the configurations to be something like so:

CentOS 6 64-bit on Firefox using Perl 5.14
CentOS 7 64-bit on Chrome using Perl 5.16

This way you would get all your supported platforms tested, but with less testing effort. Over successive verisons you would cover all the 8 combinations above eventually.

Supposing you have no platform groups defined, it is assumed that no platform is mutually exclusive; therefore only one run would be required, supposing it satisfied all the provided platforms.

Furthermore, the tests provided will be evenly apportioned amongst the sets of platforms produced, to further expedite testing.

EXTENSIBILITY

As with all the other utilities here, the backend used to store test plans is extensible by specifying the planner class in elastest.conf.

Setting client.planner=SomeClass

would correspond to App::Prove::Elasticsearch::Planner::SomeClass being loaded and used as the planner backend.

See App::Prove::Elasticsearch::Planner::Default as a template for making planner classes.

CONSTRUCTOR

new(@ARGV)

Process the passed configuration and arguments and require the necessary plugins to create or view test plans.

METHODS

run()

Creates or views test plans based on your passed data.

AUTHOR

George S. Baugh <teodesian@cpan.org>

SOURCE

The development version is on github at http://https://github.com/teodesian/App-Prove-Elasticsearch and may be cloned from git://https://github.com/teodesian/App-Prove-Elasticsearch.git

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by George S. Baugh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.