t/db_dependent/00-strict.t (tests 342, 521, 533) and t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t (test 1) fail instead of skipping when a Perl module required for them to run properly is not installed. test 342 requires Catmandu::Importer::MARC tests 521 and 533 require WebService::ILS::OverDrive::Patron test 1 requires Catmandu::Store::ElasticSearch
Created attachment 64858 [details] [review] 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)
Comment on attachment 64858 [details] [review] Bug 18899 - Tests should skip instead of failing when dependency modules are not installed Review of attachment 64858 [details] [review]: ----------------------------------------------------------------- You write: test 342 requires Catmandu::Importer::MARC tests 521 and 533 require WebService::ILS::OverDrive::Patron test 1 requires Catmandu::Store::ElasticSearch But then your code has no explicit mention of them. I think this needs some logic clean up, sorry. Even comments explaining the relationship between the requires done and why they are failing (the ones above) would be an improvement. ::: t/db_dependent/00-strict.t @@ +31,5 @@ > +if ( $@ ) { > + push @skips, 'opac/svc/overdrive'; > +} > + > +eval { require Koha::ExternalContent::OverDrive; }; This is identical to line 29. Why didn't you place line 38 as line 33? That is do both pushes in the single $@.
Interesting... I came across the same problem a while back, and hadn't gotten to documenting fixing it File: test_on_fresh_install_failures.txt "Catmandu/Importer/MARC.pm WebService/ILS/OverDrive/Patron.pm Catmandu/Store/ElasticSearch.pm"
As of the time of this comment the tests no longer fail but instead skip if modules are not installed.