[Bps-public-commit] rt-extension-rest2 branch, move-test-files, created. 1.06-9-g88961da

Jim Brandt jbrandt at bestpractical.com
Thu May 9 15:05:13 EDT 2019


The branch, move-test-files has been created
        at  88961dad2411441e283783516379c575169ebdeb (commit)

- Log -----------------------------------------------------------------
commit 90e60ddcaa52f84361b94e6f9ff90aca0b968072
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu May 9 14:02:24 2019 -0400

    Move Test.pm.in file to standard location
    
    For consistency with other RT extensions, move the Test.pm.in
    file to the standard lib tree rather than t/lib.

diff --git a/.gitignore b/.gitignore
index 69b9c1f..1902ede 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,4 @@ pod2htm*.tmp
 /MYMETA.*
 /t/tmp
 /xt/tmp
-/t/lib/RT/Extension/REST2/Test.pm
+/lib/RT/Extension/REST2/Test.pm
diff --git a/Makefile.PL b/Makefile.PL
index 1453db4..67349a2 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -42,7 +42,7 @@ substitute(
     {
         sufix => '.in'
     },
-    qw(t/lib/RT/Extension/REST2/Test.pm),
+    qw(lib/RT/Extension/REST2/Test.pm),
 );
 
 no_index package => 'RT::Extension::REST2::Test';
diff --git a/t/lib/RT/Extension/REST2/Test.pm.in b/lib/RT/Extension/REST2/Test.pm.in
similarity index 100%
rename from t/lib/RT/Extension/REST2/Test.pm.in
rename to lib/RT/Extension/REST2/Test.pm.in

commit cef3bbe796ce344633afb319a958e69ca4570723
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu May 9 14:10:25 2019 -0400

    Add boilerplate import to require local lib during tests

diff --git a/lib/RT/Extension/REST2/Test.pm.in b/lib/RT/Extension/REST2/Test.pm.in
index d4c9b5f..8ac8f3c 100644
--- a/lib/RT/Extension/REST2/Test.pm.in
+++ b/lib/RT/Extension/REST2/Test.pm.in
@@ -7,11 +7,26 @@ use warnings;
 use lib qw(/opt/rt4/local/lib /opt/rt4/lib);
 
 use base 'RT::Test';
-
-use RT::Extension::REST2;
 use Test::WWW::Mechanize::PSGI;
 use RT::User;
 
+sub import {
+    my $class = shift;
+    my %args  = @_;
+
+    $args{'requires'} ||= [];
+    if ( $args{'testing'} ) {
+        unshift @{ $args{'requires'} }, 'RT::Extension::REST2';
+    } else {
+        $args{'testing'} = 'RT::Extension::REST2';
+    }
+
+    $class->SUPER::import( %args );
+    $class->export_to_level(1);
+
+    require RT::Extension::REST2;
+}
+
 sub mech { RT::Extension::REST2::Test::Mechanize->new }
 
 {

commit 0d82523d0fbc59952fa2dc8768e4fa568d4f17f1
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu May 9 14:17:25 2019 -0400

    Move test files from t to xt
    
    Running the test suite for RT extensions requries an installed
    dev RT instance. Users installing from CPAN usually won't have
    this and installers typically run make test by default, which
    results in failures.
    
    Move tests to xt to make them available to developers, but
    avoid false failures for end users.

diff --git a/t/asset-customfields.t b/xt/asset-customfields.t
similarity index 100%
rename from t/asset-customfields.t
rename to xt/asset-customfields.t
diff --git a/t/assets.t b/xt/assets.t
similarity index 100%
rename from t/assets.t
rename to xt/assets.t
diff --git a/t/catalogs.t b/xt/catalogs.t
similarity index 100%
rename from t/catalogs.t
rename to xt/catalogs.t
diff --git a/t/conflict.t b/xt/conflict.t
similarity index 100%
rename from t/conflict.t
rename to xt/conflict.t
diff --git a/t/group-members.t b/xt/group-members.t
similarity index 100%
rename from t/group-members.t
rename to xt/group-members.t
diff --git a/t/not_found.t b/xt/not_found.t
similarity index 100%
rename from t/not_found.t
rename to xt/not_found.t
diff --git a/t/organization.t b/xt/organization.t
similarity index 100%
rename from t/organization.t
rename to xt/organization.t
diff --git a/t/queues.t b/xt/queues.t
similarity index 100%
rename from t/queues.t
rename to xt/queues.t
diff --git a/t/root.t b/xt/root.t
similarity index 100%
rename from t/root.t
rename to xt/root.t
diff --git a/t/search-json.t b/xt/search-json.t
similarity index 100%
rename from t/search-json.t
rename to xt/search-json.t
diff --git a/t/ticket-customfields.t b/xt/ticket-customfields.t
similarity index 100%
rename from t/ticket-customfields.t
rename to xt/ticket-customfields.t
diff --git a/t/ticket-customroles.t b/xt/ticket-customroles.t
similarity index 100%
rename from t/ticket-customroles.t
rename to xt/ticket-customroles.t
diff --git a/t/ticket-links.t b/xt/ticket-links.t
similarity index 100%
rename from t/ticket-links.t
rename to xt/ticket-links.t
diff --git a/t/ticket-watchers.t b/xt/ticket-watchers.t
similarity index 100%
rename from t/ticket-watchers.t
rename to xt/ticket-watchers.t
diff --git a/t/tickets-bulk.t b/xt/tickets-bulk.t
similarity index 100%
rename from t/tickets-bulk.t
rename to xt/tickets-bulk.t
diff --git a/t/tickets.t b/xt/tickets.t
similarity index 100%
rename from t/tickets.t
rename to xt/tickets.t
diff --git a/t/transactions.t b/xt/transactions.t
similarity index 100%
rename from t/transactions.t
rename to xt/transactions.t
diff --git a/t/user-customfields.t b/xt/user-customfields.t
similarity index 100%
rename from t/user-customfields.t
rename to xt/user-customfields.t
diff --git a/t/user-memberships.t b/xt/user-memberships.t
similarity index 100%
rename from t/user-memberships.t
rename to xt/user-memberships.t

commit 88961dad2411441e283783516379c575169ebdeb
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu May 9 14:39:41 2019 -0400

    Update MANIFEST

diff --git a/MANIFEST b/MANIFEST
index 98866ce..7ef88eb 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -59,29 +59,29 @@ lib/RT/Extension/REST2/Resource/Transactions.pm
 lib/RT/Extension/REST2/Resource/User.pm
 lib/RT/Extension/REST2/Resource/UserGroups.pm
 lib/RT/Extension/REST2/Resource/Users.pm
+lib/RT/Extension/REST2/Test.pm.in
 lib/RT/Extension/REST2/Util.pm
 Makefile.PL
 MANIFEST			This list of files
 META.yml
 README
-t/asset-customfields.t
-t/assets.t
-t/catalogs.t
-t/conflict.t
-t/group-members.t
-t/lib/RT/Extension/REST2/Test.pm.in
-t/not_found.t
-t/organization.t
-t/queues.t
-t/root.t
-t/search-json.t
-t/ticket-customfields.t
-t/ticket-customroles.t
-t/ticket-links.t
-t/ticket-watchers.t
-t/tickets-bulk.t
-t/tickets.t
-t/transactions.t
-t/user-customfields.t
-t/user-memberships.t
 TODO
+xt/asset-customfields.t
+xt/assets.t
+xt/catalogs.t
+xt/conflict.t
+xt/group-members.t
+xt/not_found.t
+xt/organization.t
+xt/queues.t
+xt/root.t
+xt/search-json.t
+xt/ticket-customfields.t
+xt/ticket-customroles.t
+xt/ticket-links.t
+xt/ticket-watchers.t
+xt/tickets-bulk.t
+xt/tickets.t
+xt/transactions.t
+xt/user-customfields.t
+xt/user-memberships.t
diff --git a/META.yml b/META.yml
index c5f4e70..bc77764 100644
--- a/META.yml
+++ b/META.yml
@@ -20,7 +20,7 @@ name: RT-Extension-REST2
 no_index:
   directory:
     - inc
-    - t
+    - xt
   package:
     - RT::Extension::REST2::Test
 recommends:

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list