From b70020f63f8f0729cc561e27bf7c4d2437750bf4 Mon Sep 17 00:00:00 2001 From: Lee Jamison Date: Thu, 6 Jul 2017 16:28:39 +0000 Subject: [PATCH] Bug 18899 - Tests should skip instead of failing when dependency modules are not installed Test Plan 1. Run 'prove -v t/db_dependent/00-strict.t' on a fresh Koha box. 2. Notice the failures listed caused by the missing modules in the Bug Description and number of tests ran. 3. Apply patch. 4. Re-run 'prove -v t/db_dependent/00-strict.t'. 5. Notice all tests pass and there are 1-3 less tests ran (skipped) --- t/db_dependent/00-strict.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/00-strict.t b/t/db_dependent/00-strict.t index 11e9403..5fae9a8 100644 --- a/t/db_dependent/00-strict.t +++ b/t/db_dependent/00-strict.t @@ -18,7 +18,27 @@ my @dirs = ( 'acqui', 'admin', 'authorities', 'basket', 'rewrite-config.PL', 'rotating_collections', 'serials', 'services', 'skel', 'sms', 'suggestion', 'svc', 'tags', 'tools', 'virtualshelves' ); +my @skips = ('misc/kohalib.pl', 'sms/sms_listen_windows_start.pl', 'misc/plack/koha.psgi'); + +eval { require Koha::SearchEngine::Elasticsearch::Indexer; }; + +if ( $@ ) { + push @skips, 'misc/search_tools/rebuild_elastic_search.pl'; +} + +eval { require Koha::ExternalContent::OverDrive; }; + +if ( $@ ) { + push @skips, 'opac/svc/overdrive'; +} + +eval { require Koha::ExternalContent::OverDrive; }; + +if ( $@ ) { + push @skips, 'opac/external/overdrive/auth.pl'; +} + $Test::Strict::TEST_STRICT = 0; -$Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'sms/sms_listen_windows_start.pl', 'misc/plack/koha.psgi' ]; +$Test::Strict::TEST_SKIP = [ @skips ]; all_perl_files_ok(@dirs); -- 2.1.4