Bug 5477 [SIGN-OFF] Fix test cases that require database access
authorRobin Sheat <robin@catalyst.net.nz>
Fri, 28 Jan 2011 19:04:08 +0000 (14:04 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Sat, 29 Jan 2011 04:02:31 +0000 (17:02 +1300)
This moves the DB-requiring tests out of the way, with the exception of
00-load.t which is used by the git hooks. For it, it makes it skip
loading problematic modules. This allows 'make test' to complete successfully
without a database configured, wich is a required part of making packages.

This has been tested against the v3.02.03 tag and the master branch.

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

12 files changed:
t/00-load.t
t/db_dependent/Auth.t [moved from t/Auth.t with 100% similarity]
t/db_dependent/Auth_with_cas.t [moved from t/Auth_with_cas.t with 100% similarity]
t/db_dependent/BackgroundJob.t [moved from t/BackgroundJob.t with 100% similarity]
t/db_dependent/External_BakerTaylor.t [moved from t/External_BakerTaylor.t with 100% similarity]
t/db_dependent/Record.t [moved from t/Record.t with 100% similarity]
t/db_dependent/Reports_Guided.t [moved from t/Reports_Guided.t with 100% similarity]
t/db_dependent/Serials_2.t [moved from t/Serials.t with 100% similarity]
t/db_dependent/Service.t [moved from t/Service.t with 100% similarity]
t/db_dependent/Tags.t [moved from t/Tags.t with 100% similarity]
t/db_dependent/UploadedFile.t [moved from t/UploadedFile.t with 100% similarity]
t/db_dependent/VirtualShelves_Page.t [moved from t/VirtualShelves_Page.t with 100% similarity]

index b5c7181..fa8181f 100644 (file)
@@ -13,12 +13,23 @@ find({
     wanted => sub {
         my $m = $_;
            return unless $m =~ s/[.]pm$//;
+           $m =~ s{^.*/C4/}{C4/};      
+           $m =~ s{/}{::}g;
            return if $m =~ /Auth_with_ldap/; # Dont test this, it will fail on use
            return if $m =~ /Cache/; # Cache modules are a WIP, add the tests back when we are using them more
            return if $m =~ /SIP/; # SIP modules will not load clean
-           $m =~ s{^.*/C4/}{C4/};      
-           $m =~ s{/}{::}g;
-           use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
+           return if $m =~ /C4::VirtualShelves$/; # Requires a DB
+           return if $m =~ /C4::Auth$/; # DB
+           return if $m =~ /C4::Tags$/; # DB
+           return if $m =~ /C4::Service/; # DB
+           return if $m =~ /C4::Auth_with_cas/; # DB
+           return if $m =~ /C4::BackgroundJob/; # DB
+           return if $m =~ /C4::UploadedFile/; # DB
+           return if $m =~ /C4::Record/; # DB
+           return if $m =~ /C4::Reports::Guided/; # DB
+           return if $m =~ /C4::Serials/; # DB
+           return if $m =~ /C4::VirtualShelves::Page/; # DB
+        use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
     },
 }, $lib);
 done_testing();
similarity index 100%
rename from t/Auth.t
rename to t/db_dependent/Auth.t
similarity index 100%
rename from t/Record.t
rename to t/db_dependent/Record.t
similarity index 100%
rename from t/Serials.t
rename to t/db_dependent/Serials_2.t
similarity index 100%
rename from t/Service.t
rename to t/db_dependent/Service.t
similarity index 100%
rename from t/Tags.t
rename to t/db_dependent/Tags.t