Bug 20721

Summary: Circulation.t keeps failing randomly
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 19403    
Bug Blocks: 25551, 21213    
Attachments: Bug 20721: (bug 19403 follow-up) Prevent Circulation.t to fail randomly

Description Jonathan Druart 2018-05-07 16:15:04 UTC
Now it happens when items.restricted is set to 1:

koha_1       |     #   Failed test 'No error or alert should be raised (error: RESTRICTED) (question: BIBLIO_ALREADY_ISSUED)'
koha_1       |     #   at t/db_dependent/Circulation.t line 1620.
koha_1       |     #          got: '1'
koha_1       |     #     expected: '0'
koha_1       | 
koha_1       |     #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if AllowMultipleIssuesOnABiblio=1 (error: RESTRICTED)'
koha_1       |     #   at t/db_dependent/Circulation.t line 1625.
koha_1       |     #          got: '1'
koha_1       |     #     expected: '0'
koha_1       | 
koha_1       |     #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if it is a subscription (error: RESTRICTED)'
koha_1       |     #   at t/db_dependent/Circulation.t line 1632.
koha_1       |     #          got: '1'
koha_1       |     #     expected: '0'
koha_1       | 
koha_1       |     #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if it is a subscription (error: RESTRICTED)'
koha_1       |     #   at t/db_dependent/Circulation.t line 1636.
koha_1       |     #          got: '1'
koha_1       |     #     expected: '0'
koha_1       |     # Looks like you failed 4 tests of 5.
koha_1       | 
koha_1       | #   Failed test 'CanBookBeIssued + AllowMultipleIssuesOnABiblio'
koha_1       | #   at t/db_dependent/Circulation.t line 1637.
koha_1       | # Looks like you failed 1 test of 116.
koha_1       | [16:00:17] t/db_dependent/Circulation.t ...................................
Comment 1 Jonathan Druart 2018-05-07 16:17:08 UTC
Created attachment 75137 [details] [review]
Bug 20721: (bug 19403 follow-up) Prevent Circulation.t to fail randomly

If items.restricted == 1, CanBookBeIssued will not returned what we are
testing.

The easiest and global fix is to define a default value at TestBuilder
package level

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 2 Jonathan Druart 2018-05-07 16:17:41 UTC
Patch pushed to master for 18.05
Comment 3 Nick Clemens (kidclamp) 2018-05-14 21:02:06 UTC
Pushed to stbale for 17.11.06

Awesome work all!
Comment 4 Fridolin Somers 2018-05-22 11:13:23 UTC
Pushed to 17.05.x for v17.05.12