Bug 29273 - Warning not caught in tests for plugins
Summary: Warning not caught in tests for plugins
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks: 25515
  Show dependency treegraph
 
Reported: 2021-10-19 13:58 UTC by Jonathan Druart
Modified: 2022-12-12 21:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 29273: Remove warnings from plugin tests (10.14 KB, patch)
2021-10-19 13:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29273: Remove warnings from plugin tests (11.89 KB, patch)
2021-10-20 10:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29273: Remove warnings from plugin tests (11.92 KB, patch)
2021-10-20 11:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 29273: Remove warnings from plugin tests (12.10 KB, patch)
2021-11-13 13:01 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 29273: Fix failing tests (3.05 KB, patch)
2021-11-15 13:16 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.