Browse Source

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 <chris.nighswonger@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
3.6.x-rmaint/testing
Robin Sheat 11 years ago
committed by Chris Cormack
parent
commit
9df2a4a8fc
  1. 17
      t/00-load.t
  2. 0
      t/db_dependent/Auth.t
  3. 0
      t/db_dependent/Auth_with_cas.t
  4. 0
      t/db_dependent/BackgroundJob.t
  5. 0
      t/db_dependent/External_BakerTaylor.t
  6. 0
      t/db_dependent/Record.t
  7. 0
      t/db_dependent/Reports_Guided.t
  8. 0
      t/db_dependent/Serials_2.t
  9. 0
      t/db_dependent/Service.t
  10. 0
      t/db_dependent/Tags.t
  11. 0
      t/db_dependent/UploadedFile.t
  12. 0
      t/db_dependent/VirtualShelves_Page.t

17
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();

0
t/Auth.t → t/db_dependent/Auth.t

0
t/Auth_with_cas.t → t/db_dependent/Auth_with_cas.t

0
t/BackgroundJob.t → t/db_dependent/BackgroundJob.t

0
t/External_BakerTaylor.t → t/db_dependent/External_BakerTaylor.t

0
t/Record.t → t/db_dependent/Record.t

0
t/Reports_Guided.t → t/db_dependent/Reports_Guided.t

0
t/Serials.t → t/db_dependent/Serials_2.t

0
t/Service.t → t/db_dependent/Service.t

0
t/Tags.t → t/db_dependent/Tags.t

0
t/UploadedFile.t → t/db_dependent/UploadedFile.t

0
t/VirtualShelves_Page.t → t/db_dependent/VirtualShelves_Page.t

Loading…
Cancel
Save