[Rt-commit] rt branch, 4.2/run-tests-with-plugins-from-env, created. rt-4.1.19-13-g62f235e
Thomas Sibley
trs at bestpractical.com
Tue Aug 13 21:07:00 EDT 2013
The branch, 4.2/run-tests-with-plugins-from-env has been created
at 62f235e347259a47fa98edabd674930914bc480b (commit)
- Log -----------------------------------------------------------------
commit 62f235e347259a47fa98edabd674930914bc480b
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jan 25 18:18:53 2013 -0800
Tests: Enable any plugins listed in RT_TEST_PLUGINS
RT_TEST_PLUGINS should be a space-separated value containing a list of
plugin names (the same names that go in @Plugins).
The root directory for each plugin may be set via an environment
variable as well, in case the plugin isn't installed in the normal
location. These environment names take the form of:
RT_TEST_PLUGIN_<plugin name>_ROOT
and the value should be an absolute path. The <plugin name> segment may
preserve the double colon package separators, omit them entirely, or
replace them with underscores (_) or hyphens (-). For example, all of
the following are legal for a plugin named "RT::Extension::Example":
RT_TEST_PLUGIN_RTExtensionExample_ROOT
RT_TEST_PLUGIN_RT::Extension::Example_ROOT
RT_TEST_PLUGIN_RT_Extension_Example_ROOT
RT_TEST_PLUGIN_RT-Extension-Example_ROOT
The overriding of plugin roots (but not enabled plugins) was previously
available via similarly named CHIMPS_<plugin name>_ROOT variables (to
support the Test::Chimps framework, now abandoned).
The upshot of these simple changes is the ability to run all or parts of
RT's core test suite with one or more plugins loaded, thus testing the
plugins' effect (or really, lack thereof) on core operations.
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 04331ec..de56ef9 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -138,6 +138,8 @@ sub import {
if $args{'requires'};
push @{ $args{'plugins'} ||= [] }, $args{'testing'}
if $args{'testing'};
+ push @{ $args{'plugins'} ||= [] }, split " ", $ENV{RT_TEST_PLUGINS}
+ if $ENV{RT_TEST_PLUGINS};
$class->bootstrap_tempdir;
@@ -514,7 +516,7 @@ sub bootstrap_plugins_paths {
if ( grep $name eq $_, @plugins ) {
my $variants = join "(?:|::|-|_)", map "\Q$_\E", split /::/, $name;
- my ($path) = map $ENV{$_}, grep /^CHIMPS_(?:$variants).*_ROOT$/i, keys %ENV;
+ my ($path) = map $ENV{$_}, grep /^RT_TEST_PLUGIN_(?:$variants).*_ROOT$/i, keys %ENV;
return $path if $path;
}
return $old_func->(@_);
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list