Bug 29862 - TestBuilder.t fails with ES enabled
Summary: TestBuilder.t fails with ES enabled
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-12 14:45 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2023-12-28 20:43 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.11,20.11.17
Circulation function:


Attachments
Bug 29862: Add missing txn begin/rollback in TestBuilder.t (7.58 KB, patch)
2022-01-17 10:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29862: Add missing txn begin/rollback in TestBuilder.t (7.64 KB, patch)
2022-01-19 15:40 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2022-01-12 14:45:51 UTC
To reproduce:

kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/TestBuilder.t 
t/db_dependent/TestBuilder.t .. 7/15 Invalid MARC field expression: nHiaHpae3NgZlIHLjw1aOK4orw_8D8Af9R8WOo4cDSyifeMJyb2e_s2UzLX_EJHr7i01S1P4uyRIwHzyQRp2xogLJamtpafxr73jNPmoKuxhtgbEUhXuNUdUWG8GquTLhIHSNixvJCboujpzt6j2f8T5AcSxSbfPiNhKaAkMufwMVzQmsW26LUo3Y1cedm_aN9yQ9cwxNIqiwSjH1CiUg3IP2iwQSZdUJg57uCmDCcexDc6CDix at /kohadevbox/koha/C4/Biblio.pm line 306.
    # Looks like you planned 12 tests but ran 6.

#   Failed test 'Tests for delete method'
#   at t/db_dependent/TestBuilder.t line 302.
Can't call method "biblionumber" on an undefined value at t/db_dependent/TestBuilder.t line 281.
# Looks like your test exited with 11 just after 8.
t/db_dependent/TestBuilder.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 8/15 subtests 

Test Summary Report
-------------------
t/db_dependent/TestBuilder.t (Wstat: 2816 Tests: 8 Failed: 1)
  Failed test:  8
  Non-zero exit status: 11
  Parse errors: Bad plan.  You planned 15 tests but ran 8.
Files=1, Tests=8, 26 wallclock secs ( 0.02 usr  0.00 sys + 18.06 cusr  5.22 csys = 23.30 CPU)
Result: FAIL
Comment 1 Jonathan Druart 2022-01-17 10:42:03 UTC
Created attachment 129522 [details] [review]
Bug 29862: Add missing txn begin/rollback in TestBuilder.t

It fixes the tests when SearchEngine=ES
 t/db_dependent/TestBuilder.t .. 7/15 Invalid MARC field expression: l5ffglZ_upqqcwOvaiyALgXfyJw2Ot2AGRPUsiAPzSFHfd8J_hsnuQ8z75B8RKc_kyo2rFBp8BrPNwcM1FPhc01ngP01HU_Z7Rx1VHfcIcmrifYnjBDWNmYB9N5_4xEnxMH7ZhqC9b2Bz9wf9
 wSEmx64x6t5xFFKX at /kohadevbox/koha/C4/Biblio.pm line 306.
     # Looks like you planned 12 tests but ran 6.

 #   Failed test 'Tests for delete method'
 #   at t/db_dependent/TestBuilder.t line 302.
 Can't call method "biblionumber" on an undefined value at t/db_dependent/TestBuilder.t line 281.
 # Looks like your test exited with 11 just after 8.

Previous subtest created invalid date in the ES mappings.

Test plan:
Set SearchEngine=ES and run the tests, they must pass.
Comment 2 Martin Renvoize (ashimema) 2022-01-19 15:40:04 UTC
Created attachment 129616 [details] [review]
Bug 29862: Add missing txn begin/rollback in TestBuilder.t

It fixes the tests when SearchEngine=ES
 t/db_dependent/TestBuilder.t .. 7/15 Invalid MARC field expression: l5ffglZ_upqqcwOvaiyALgXfyJw2Ot2AGRPUsiAPzSFHfd8J_hsnuQ8z75B8RKc_kyo2rFBp8BrPNwcM1FPhc01ngP01HU_Z7Rx1VHfcIcmrifYnjBDWNmYB9N5_4xEnxMH7ZhqC9b2Bz9wf9
 wSEmx64x6t5xFFKX at /kohadevbox/koha/C4/Biblio.pm line 306.
     # Looks like you planned 12 tests but ran 6.

 #   Failed test 'Tests for delete method'
 #   at t/db_dependent/TestBuilder.t line 302.
 Can't call method "biblionumber" on an undefined value at t/db_dependent/TestBuilder.t line 281.
 # Looks like your test exited with 11 just after 8.

Previous subtest created invalid date in the ES mappings.

Test plan:
Set SearchEngine=ES and run the tests, they must pass.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2022-01-19 15:40:24 UTC
Works for me... signing off
Comment 4 Jonathan Druart 2022-01-27 16:09:24 UTC
Trivial, skipping QA.
Comment 5 Fridolin Somers 2022-02-01 07:57:19 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 6 Kyle M Hall (khall) 2022-02-07 16:38:20 UTC
Pushed to 21.11.x for 21.11.03
Comment 7 Andrew Fuerste-Henry 2022-02-21 15:41:21 UTC
Pushed to 21.05.x for 21.05.11
Comment 8 Victor Grousset/tuxayo 2022-02-24 22:34:34 UTC
Backported: Pushed to 20.11.x branch for 20.11.16
Comment 9 Wainui Witika-Park 2022-03-07 03:44:58 UTC
Does this need to be backported to 19.11.x?