[Bug 21985] New: Test t/db_dependent/Circulation.t fails if SearchEngine is set to elasticsearch
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Bug ID: 21985 Summary: Test t/db_dependent/Circulation.t fails if SearchEngine is set to elasticsearch Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: josef.moravec@gmail.com QA Contact: testopia@bugs.koha-community.org The test t/db_dependent/Circulation.t fails with: not ok 106 - No tests run for subtest "CanBookBeIssued & AllowReturnToBranch" # Failed test 'No tests run for subtest "CanBookBeIssued & AllowReturnToBranch"' # at t/db_dependent/Circulation.t line 1302. Can't call method "leader" on an undefined value at /home/vagrant/kohaclone/Koha/SearchEngine/Elasticsearch.pm line 419. # Looks like your test exited with 255 just after 106. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 83254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83254&action=edit Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item We should use build_sample item (from bug 21971) to create items, otherwise we may not have a valid biblioitem and/or MARC record. Test plan: Set SearchEngine to ES prove that the tests in Circulation.t now pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21971 CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|chris@bigballofwax.co.nz |jonathan.druart@bugs.koha-c | |ommunity.org Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21971 [Bug 21971] TestBuilder::build_sample_item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Bug 21985 depends on bug 21971, which changed state. Bug 21971 Summary: TestBuilder::build_sample_item https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21971 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Bug 21985 depends on bug 21971, which changed state. Bug 21971 Summary: TestBuilder::build_sample_item https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21971 What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hayleymapley@catalyst.net.n | |z --- Comment #2 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #1)
Created attachment 83254 [details] [review] Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item
We should use build_sample item (from bug 21971) to create items, otherwise we may not have a valid biblioitem and/or MARC record.
Test plan: Set SearchEngine to ES prove that the tests in Circulation.t now pass
Hi, could you please provide a more detailed description for the test step 'set SearchEngine to ES'? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Hayley, there is a system preference SearchEngine you can switch between Zebra and Elasticsearch. Depending on what you use for testing there might be more steps needed, in a kohadevbox you should be ok with switching the pref and doing a reindex. The script for reindexing Elasticsearch can be run using koha-shell and is in misc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #4 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- (In reply to Katrin Fischer from comment #3)
Hi Hayley, there is a system preference SearchEngine you can switch between Zebra and Elasticsearch. Depending on what you use for testing there might be more steps needed, in a kohadevbox you should be ok with switching the pref and doing a reindex. The script for reindexing Elasticsearch can be run using koha-shell and is in misc.
Thank you Katrin! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #5 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Before applying the patch, I get this error when trying to prove those tests: t/db_dependent/Circulation.t .. 61/126 DBD::mysql::st execute failed: Duplicate entry '10' for key 'PRIMARY' [for Statement "INSERT INTO `old_issues` ( `auto_renew`, `auto_renew_error`, `borrowernumber`, `branchcode`, `date_due`, `issue_id`, `issuedate`, `itemnumber`, `lastreneweddate`, `note`, `notedate`, `noteseen`, `onsite_checkout`, `renewals`, `returndate`, `timestamp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0=0, 1=undef, 2=54, 3='bWmeAOZip', 4='2019-03-25 23:59:00', 5=10, 6='2019-03-11 03:36:44', 7=991, 8=undef, 9=undef, 10=undef, 11=undef, 12=0, 13=undef, 14='2019-03-11 03:36:47', 15='2019-03-11 03:36:47'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. {UNKNOWN}: Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Duplicate entry '10' for key 'PRIMARY' [for Statement "INSERT INTO `old_issues` ( `auto_renew`, `auto_renew_error`, `borrowernumber`, `branchcode`, `date_due`, `issue_id`, `issuedate`, `itemnumber`, `lastreneweddate`, `note`, `notedate`, `noteseen`, `onsite_checkout`, `renewals`, `returndate`, `timestamp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0=0, 1=undef, 2=54, 3='bWmeAOZip', 4='2019-03-25 23:59:00', 5=10, 6='2019-03-11 03:36:44', 7=991, 8=undef, 9=undef, 10=undef, 11=undef, 12=0, 13=undef, 14='2019-03-11 03:36:47', 15='2019-03-11 03:36:47'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. " (perhaps you forgot to load "DBD::mysql::st execute failed: Duplicate entry '10' for key 'PRIMARY' [for Statement "INSERT INTO `old_issues` ( `auto_renew`, `auto_renew_error`, `borrowernumber`, `branchcode`, `date_due`, `issue_id`, `issuedate`, `itemnumber`, `lastreneweddate`, `note`, `notedate`, `noteseen`, `onsite_checkout`, `renewals`, `returndate`, `timestamp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0=0, 1=undef, 2=54, 3='bWmeAOZip', 4='2019-03-25 23:59:00', 5=10, 6='2019-03-11 03:36:44', 7=991, 8=undef, 9=undef, 10=undef, 11=undef, 12=0, 13=undef, 14='2019-03-11 03:36:47', 15='2019-03-11 03:36:47'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. "?) at /home/vagrant/kohaclone/Koha/Object.pm line 185. at /home/vagrant/kohaclone/C4/Circulation.pm line 2206 # Looks like your test exited with 255 just after 71. t/db_dependent/Circulation.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 55/126 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 65280 Tests: 71 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 126 tests but ran 71. Files=1, Tests=71, 7 wallclock secs ( 0.03 usr 0.01 sys + 3.42 cusr 0.38 csys = 3.84 CPU) Result: FAIL And the patch does not apply: Applying: Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item error: sha1 information is lacking or useless (t/db_dependent/Circulation.t). error: could not build fake ancestor Patch failed at 0001 Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #6 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- (In reply to Hayley Mapley from comment #5)
Before applying the patch, I get this error when trying to prove those tests:
t/db_dependent/Circulation.t .. 61/126 DBD::mysql::st execute failed: Duplicate entry '10' for key 'PRIMARY' [for Statement "INSERT INTO `old_issues` ( `auto_renew`, `auto_renew_error`, `borrowernumber`, `branchcode`, `date_due`, `issue_id`, `issuedate`, `itemnumber`, `lastreneweddate`, `note`, `notedate`, `noteseen`, `onsite_checkout`, `renewals`, `returndate`, `timestamp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0=0, 1=undef, 2=54, 3='bWmeAOZip', 4='2019-03-25 23:59:00', 5=10, 6='2019-03-11 03:36:44', 7=991, 8=undef, 9=undef, 10=undef, 11=undef, 12=0, 13=undef, 14='2019-03-11 03:36:47', 15='2019-03-11 03:36:47'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. {UNKNOWN}: Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Duplicate entry '10' for key 'PRIMARY' [for Statement "INSERT INTO `old_issues` ( `auto_renew`, `auto_renew_error`, `borrowernumber`, `branchcode`, `date_due`, `issue_id`, `issuedate`, `itemnumber`, `lastreneweddate`, `note`, `notedate`, `noteseen`, `onsite_checkout`, `renewals`, `returndate`, `timestamp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0=0, 1=undef, 2=54, 3='bWmeAOZip', 4='2019-03-25 23:59:00', 5=10, 6='2019-03-11 03:36:44', 7=991, 8=undef, 9=undef, 10=undef, 11=undef, 12=0, 13=undef, 14='2019-03-11 03:36:47', 15='2019-03-11 03:36:47'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. " (perhaps you forgot to load "DBD::mysql::st execute failed: Duplicate entry '10' for key 'PRIMARY' [for Statement "INSERT INTO `old_issues` ( `auto_renew`, `auto_renew_error`, `borrowernumber`, `branchcode`, `date_due`, `issue_id`, `issuedate`, `itemnumber`, `lastreneweddate`, `note`, `notedate`, `noteseen`, `onsite_checkout`, `renewals`, `returndate`, `timestamp`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0=0, 1=undef, 2=54, 3='bWmeAOZip', 4='2019-03-25 23:59:00', 5=10, 6='2019-03-11 03:36:44', 7=991, 8=undef, 9=undef, 10=undef, 11=undef, 12=0, 13=undef, 14='2019-03-11 03:36:47', 15='2019-03-11 03:36:47'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. "?) at /home/vagrant/kohaclone/Koha/Object.pm line 185. at /home/vagrant/kohaclone/C4/Circulation.pm line 2206 # Looks like your test exited with 255 just after 71. t/db_dependent/Circulation.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 55/126 subtests
Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 65280 Tests: 71 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 126 tests but ran 71. Files=1, Tests=71, 7 wallclock secs ( 0.03 usr 0.01 sys + 3.42 cusr 0.38 csys = 3.84 CPU) Result: FAIL
And the patch does not apply: Applying: Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item error: sha1 information is lacking or useless (t/db_dependent/Circulation.t). error: could not build fake ancestor Patch failed at 0001 Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item
Actually reading this error, I see that it's an issue with the DB, which I will fix and then try again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #7 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Test fails with the following error: t/db_dependent/Circulation.t .. 122/126 # No tests run! t/db_dependent/Circulation.t .. 123/126 # Failed test 'No tests run for subtest "AddRenewal and AddIssuingCharge tests"' # at t/db_dependent/Circulation.t line 2948. Can't call method "lengthunit" on an undefined value at /home/vagrant/kohaclone/Koha/Charges/Fees.pm line 101. # Looks like your test exited with 11 just after 123. t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00) Failed 4/126 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 2816 Tests: 123 Failed: 1) Failed test: 123 Non-zero exit status: 11 Parse errors: Bad plan. You planned 126 tests but ran 123. Files=1, Tests=123, 38 wallclock secs ( 0.07 usr 0.01 sys + 18.59 cusr 3.22 csys = 21.89 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83254|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 86634 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86634&action=edit Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item We should use build_sample item (from bug 21971) to create items, otherwise we may not have a valid biblioitem and/or MARC record. Test plan: Set SearchEngine to ES prove that the tests in Circulation.t now pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 86635 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86635&action=edit Bug 21985: Trying to fix the next failure -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Failed QA Assignee|jonathan.druart@bugs.koha-c |chris@bigballofwax.co.nz |ommunity.org | --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hayley, you do not have all the sample data. You must have them into your DB to have the tests running correctly. However there is an error, but another one: t/db_dependent/Circulation.t .. 114/126 # Failed test 'Lost item with cancelled hold has holding branch equallying the transfers source branch' # at t/db_dependent/Circulation.t line 2441. # got: 'XX_vS1zKTd' # expected: 'KazYKXl' # Looks like you failed 1 test of 5. t/db_dependent/Circulation.t .. 117/126 # Failed test 'Cancel transfers on lost items' I am not able to fix it. Could someone else have a try? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major CC| |nick@bywatersolutions.com --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nick, I am raising the severity of this one. Since I have written the patch we have added new occurrences of the problematic pattern. We must have this one included into master to prevent further regressions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Bug 21985 depends on bug 21971, which changed state. Bug 21971 Summary: TestBuilder::build_sample_item https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21971 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #86634|0 |1 is obsolete| | Attachment #86635|0 |1 is obsolete| | --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 93259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93259&action=edit Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item We should use build_sample item (from bug 21971) to create items, otherwise we may not have a valid biblioitem and/or MARC record. Test plan: Set SearchEngine to ES prove that the tests in Circulation.t now pass Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 93260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93260&action=edit Bug 21985: Trying to fix the next failure Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 93261 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93261&action=edit Bug 21985: Fix further occurences Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works well, thanks Jonathan. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|19.11.00 |19.11.00,19.05.05 released in| | --- Comment #17 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 19.05.x for 19.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21985 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #18 from Lucas Gass <lucas@bywatersolutions.com> --- 18.11.x is missing the bz21971 dependency so I will not backport for 18.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org