App-Prove-Plugin-Elasticsearch

 view release on metacpan or  search on metacpan

lib/App/Prove/Plugin/Elasticsearch.pm  view on Meta::CPAN

=item B<elapsed>: the time it took the test to execute

=item B<occurred>: when the test began execution

=item B<executor>: the name of the executor.  This can be passed as executor=.  Defaults to root @ the host executed on.

=item B<version>: the version of the system under test.  See the versioner option as to how this is obtained.

=item B<environment>: the environment of the system under test.  See the platformer option as to how this is obtained.

=item B<name>: the filename of the test run

=item B<path>: the path to the test.  This is to allow tests with the same name at different paths to report correctly.

=item B<status>: whether the test global result was PASS, FAIL, SKIP, etc.  See L<App::Prove::Elasticsearch::Parser> for the rules as to these statuses.

=item B<steps>: detailed information (es object) as to the name, elapsed time, status and step # for each step.

=back

If this index does not exist, it will be created for you.
If an index exists with that name an exception will be thrown.
To override the index name to avoid exceptions, subclass App::Prove::Elasticsearch::Indexer and use your own name.
The name searched for must be a child of the App::Prove::Elasticsearch::Indexer, e.g. App::Prove::Elasticsearch::Indexer::EvilIndexer.

You may have noticed that this pluggable design does not necessarily mean you need to use elasticsearch as your indexer;
so long as the information above is all you need for your test management system, there's no reason you couldn't make a custom indexer for it.

There are also some shipped indexer extensions:

=over 4

=item B<DzilDist>: Names the index based on what your distribution is named in dist.ini

=item B<MMDist>: Names the index based on what your distribution is named in Makefile.PL

=back

=head2 VERSIONER

The version getter is necessarily complicated, as all perl modules do not necessarily provide a reliable method of acquiring this.
As such this behavior can be modified with the versioner= parameter.
This module ships with various versioners:

=over 4

=item B<Default>: used if no versioner is passed, the latest version in Changes is used.  Basically the CPAN module workflow.

=item B<Git>: use the latest SHA for the file.

=item B<Env>: use $ENV{TESTSUITE_VERSION} as the value used.  Handy when testing remote systems.

=back

App::Prove::Elasticsearch::Provisioner is built to be subclassed to discern the version used by your application.
For example, App::Prove::Elasticsearch::Provisioner::Default provides the 'Default' versioner.

=head2 PLATFORMER

Given that tests run on various platforms, we need a flexible way to determine that information.
As such, I've provided (you guessed it) yet another pluggable interface, App::Prove::Elasticsearch::Platformer.
Here are the shipped plugins:

=over 4

=item B<Default>: use Sys::Info::OS to determine the operating system environment, and $^V for the interpreter environment.

=item B<Env>: use $ENV{TESTSUITE_PLATFORM} as the environment.  Accepts comma separated variables.

=back

Unlike the other pluggable interfaces, this is intended to return an array of platforms describing the system under test.

=head2 BLAMER

All test results should be directly attributable to some entity.
As such, you can subclass App::Prove::Elasticsearch::Blamer to blame whatever is convenient for test results.
This module ships with:

=over 4

=item B<Default>: The latest author listed in Changes.

=item B<System>: user executing @ hostname

=item B<Git>: git config's author.email.

=item B<Env>: whatever is set in $ENV{TESTSUITE_EXECUTOR}.

=back

=head2 INDEXER

=head2 AUTODISCOVER

Passing the client.autodiscover option makes the Test Harness eject tests which have results indexed for the relevant configuration.
The value is the class in the App::Prove::Elasticsearch::Searcher::* namespace you wish to use to autodiscover results.
This module ships with:

=over 4

=item B<ByName>: Checks for results with the same name and path as the provided tests.

=back

By default, this option is NOT set, and tests will simply be re-run and indexed.

=head2 QUEUE

By default, when running test plans via -PElasticsearch='plan=SomePlan,...', we run everything in the plan possible based on the local host's configuration.
In some situations though, you might have more work than your local host can satisfy, and need to distribute your testing load.

To facilitate that, App::Prove::Elasticsearch::Queue::* modules have been provided to assist you in going about that:

=over 4

=item B<Default>: Runs everything in the plan possible based on localhost's configuration, as defined by your platformer/versioner.

=item B<Rabbit>:  Use RabbitMQ to run a portion of the queue relevant to the host's configuration, as defined by your platformer/versioner.

A tool (bin/testd) has also been provided to leverage these queues by watching and waiting for work.



( run in 1.848 second using v1.01-cache-2.11-cpan-39bf76dae61 )