From 9df2a4a8fc24ebb693ffb80a218b12137f8b282d Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 28 Jan 2011 14:04:08 -0500 Subject: [PATCH] Bug 5477 [SIGN-OFF] Fix test cases that require database access 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 Signed-off-by: Chris Cormack --- t/00-load.t | 17 ++++++++++++++--- t/{ => db_dependent}/Auth.t | 0 t/{ => db_dependent}/Auth_with_cas.t | 0 t/{ => db_dependent}/BackgroundJob.t | 0 t/{ => db_dependent}/External_BakerTaylor.t | 0 t/{ => db_dependent}/Record.t | 0 t/{ => db_dependent}/Reports_Guided.t | 0 t/{Serials.t => db_dependent/Serials_2.t} | 0 t/{ => db_dependent}/Service.t | 0 t/{ => db_dependent}/Tags.t | 0 t/{ => db_dependent}/UploadedFile.t | 0 t/{ => db_dependent}/VirtualShelves_Page.t | 0 12 files changed, 14 insertions(+), 3 deletions(-) rename t/{ => db_dependent}/Auth.t (100%) rename t/{ => db_dependent}/Auth_with_cas.t (100%) rename t/{ => db_dependent}/BackgroundJob.t (100%) rename t/{ => db_dependent}/External_BakerTaylor.t (100%) rename t/{ => db_dependent}/Record.t (100%) rename t/{ => db_dependent}/Reports_Guided.t (100%) rename t/{Serials.t => db_dependent/Serials_2.t} (100%) rename t/{ => db_dependent}/Service.t (100%) rename t/{ => db_dependent}/Tags.t (100%) rename t/{ => db_dependent}/UploadedFile.t (100%) rename t/{ => db_dependent}/VirtualShelves_Page.t (100%) diff --git a/t/00-load.t b/t/00-load.t index b5c7181f87..fa8181fdc3 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -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(); diff --git a/t/Auth.t b/t/db_dependent/Auth.t similarity index 100% rename from t/Auth.t rename to t/db_dependent/Auth.t diff --git a/t/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t similarity index 100% rename from t/Auth_with_cas.t rename to t/db_dependent/Auth_with_cas.t diff --git a/t/BackgroundJob.t b/t/db_dependent/BackgroundJob.t similarity index 100% rename from t/BackgroundJob.t rename to t/db_dependent/BackgroundJob.t diff --git a/t/External_BakerTaylor.t b/t/db_dependent/External_BakerTaylor.t similarity index 100% rename from t/External_BakerTaylor.t rename to t/db_dependent/External_BakerTaylor.t diff --git a/t/Record.t b/t/db_dependent/Record.t similarity index 100% rename from t/Record.t rename to t/db_dependent/Record.t diff --git a/t/Reports_Guided.t b/t/db_dependent/Reports_Guided.t similarity index 100% rename from t/Reports_Guided.t rename to t/db_dependent/Reports_Guided.t diff --git a/t/Serials.t b/t/db_dependent/Serials_2.t similarity index 100% rename from t/Serials.t rename to t/db_dependent/Serials_2.t diff --git a/t/Service.t b/t/db_dependent/Service.t similarity index 100% rename from t/Service.t rename to t/db_dependent/Service.t diff --git a/t/Tags.t b/t/db_dependent/Tags.t similarity index 100% rename from t/Tags.t rename to t/db_dependent/Tags.t diff --git a/t/UploadedFile.t b/t/db_dependent/UploadedFile.t similarity index 100% rename from t/UploadedFile.t rename to t/db_dependent/UploadedFile.t diff --git a/t/VirtualShelves_Page.t b/t/db_dependent/VirtualShelves_Page.t similarity index 100% rename from t/VirtualShelves_Page.t rename to t/db_dependent/VirtualShelves_Page.t -- 2.20.1