[Koha-bugs] [Bug 18445] Tests in t stumble over Auth's BEGIN block

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 18 15:28:33 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18445

--- Comment #1 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 62290
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62290&action=edit
Bug 18445: Replace two use C4::Auth statements

Both Serials.pm and Virtualshelf.pm only need haspermission in a specific
sub. Since loading the module at compile-time triggers early execution of
the BEGIN block, this results in database access in the tests that are
assumed to be database independent.

At the same time we are resolving test failures in Matcher.t and Prices.t
because the schema mock is too late.

Test plan:
[1] Do not yet apply this patch. Backup your database.
[2] Drop the database and create a new empty one.
[3] Run the tests in t. Look at Matcher.t and Prices.t too.
    You will see quite some occurrences of:
    DBD::mysql::st execute failed: Table 'koha_master.systempreferences'
doesn't exist [for Statement "SELECT `me`.`variable`, `me`.`value`,
`me`.`options`, `me`.`explanation`, `me`.`type` FROM `systempreferences` `me`
WHERE ( `me`.`variable` = ? )" with ParamValues: 0='casauthentication'] at
/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.

[4] Apply this patch.
[5] Run the tests in t again. Check the results of Matcher.t and Prices.t.
[6] Restore your database.
[7] Run t/db_dependent/Serials_2.t to trigger the change in Serials.
[8] Run t/db_dependent/Virtualshelves.t to test Koha/Virtualshelf.

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list