Bug 29273

Summary: Warning not caught in tests for plugins
Product: Koha Reporter: Jonathan Druart <jonathan.druart+koha>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart+koha>
Status: RESOLVED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: normal    
Priority: P5 - low CC: david, kyle, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22709
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00
Bug Depends on:    
Bug Blocks: 25515    
Attachments: Bug 29273: Remove warnings from plugin tests
Bug 29273: Remove warnings from plugin tests
Bug 29273: Remove warnings from plugin tests
Bug 29273: Remove warnings from plugin tests
Bug 29273: Fix failing tests

Description Jonathan Druart 2021-10-19 13:58:19 UTC

    
Comment 1 Jonathan Druart 2021-10-19 13:59:32 UTC
Created attachment 126503 [details] [review]
Bug 29273: Remove warnings from plugin tests

This patch is suggesting to move the broken test plugins into a separate
directory.

t/lib/plugins and t/lib/bad_plugins
Comment 2 Jonathan Druart 2021-10-19 14:01:03 UTC
There are still warnings raised by calls to item_barcode_transform patron_barcode_transform. I am not sure how to deal with them correctly.
Those hooks should actually be disabled when we don't want to test their behaviour.
Comment 3 Jonathan Druart 2021-10-20 10:06:37 UTC
Created attachment 126567 [details] [review]
Bug 29273: Remove warnings from plugin tests

This patch is suggesting to move the broken test plugins into a separate
directory.

t/lib/plugins and t/lib/bad_plugins
Comment 4 David Nind 2021-10-20 11:43:03 UTC
Created attachment 126582 [details] [review]
Bug 29273: Remove warnings from plugin tests

This patch is suggesting to move the broken test plugins into a separate
directory.

t/lib/plugins and t/lib/bad_plugins

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2021-10-20 11:44:13 UTC
Tested by making sure tests pass bother before and after patch applied. Hope that is sufficient.

Tests pass before and after apply patch for existing tests:
prove t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t 
prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
prove t/db_dependent/Koha/Plugins/Circulation_hooks.t
prove t/db_dependent/Koha/Plugins/Holds_hooks.t
prove t/db_dependent/Koha/Plugins/Patron.t
prove t/db_dependent/Koha/Plugins/Plugins.t 

Tests pass for new test:
prove t/db_dependent/Koha/Plugins/Broken.t
Comment 6 Katrin Fischer 2021-10-24 11:50:37 UTC
I am still having local issues with yamlxs, so can't finish here right now :( 

Leaving that here in case someone can help me fix:

t/db_dependent/Koha/Plugins/Plugins.t ........................ 6/61 new(): failed: couldn't load CGI::Session::Serialize::yamlxs: Can't locate CGI/Session/Serialize/yamlxs.pm in @INC (you may need to install the CGI::Session::Serialize::yamlxs module) (@INC contains: /home/vagrant/kohaclone /home/vagrant/qa-test-tools /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base t/db_dependent/Koha/Plugins/../../../lib/plugins) at (eval 1739) line 2.
# Looks like your test exited with 2 just after 38.
t/db_dependent/Koha/Plugins/Plugins.t ........................ Dubious, test returned 2 (wstat 512, 0x200)
Failed 23/61 subtests
Comment 7 Jonathan Druart 2021-10-25 08:23:23 UTC
You need that line
  333         PERL5LIB="$KOHA_HOME:$KOHA_HOME/lib"
in debian/scripts/koha-functions.sh

See commit 40089a0a538dffca7ee5bd619b902b9830e4460c
    Bug 28519: Put CGI::Session::Serialize::yamlxs in lib directory
Comment 8 Joonas Kylmälä 2021-11-13 13:01:03 UTC
Created attachment 127605 [details] [review]
Bug 29273: Remove warnings from plugin tests

This patch is suggesting to move the broken test plugins into a separate
directory.

t/lib/plugins and t/lib/bad_plugins

Signed-off-by: David Nind <david@davidnind.com>
JK: Add executable bit to Broken.t
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 9 Jonathan Druart 2021-11-15 11:40:01 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 10 Jonathan Druart 2021-11-15 13:16:01 UTC
Created attachment 127643 [details] [review]
Bug 29273: Fix failing tests
Comment 11 Jonathan Druart 2021-11-15 14:08:07 UTC
(In reply to Jonathan Druart from comment #10)
> Created attachment 127643 [details] [review] [review]
> Bug 29273: Fix failing tests

Pushed to master.