Bug 24062 - Circulation tests fail randomly if patron category type is 'X'
Summary: Circulation tests fail randomly if patron category type is 'X'
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: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 25551
  Show dependency treegraph
 
Reported: 2019-11-19 09:17 UTC by Jonathan Druart
Modified: 2021-12-13 21:08 UTC (History)
3 users (show)

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


Attachments
Bug 24062: [DO NOT PUSH] Proof (1.40 KB, patch)
2019-11-19 09:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24062: Fix the failing test (2.31 KB, patch)
2019-11-19 09:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types (2.93 KB, patch)
2019-11-19 09:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24062: [DO NOT PUSH] Proof (1.47 KB, patch)
2019-11-19 11:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24062: Fix the failing test (2.38 KB, patch)
2019-11-19 11:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types (3.00 KB, patch)
2019-11-19 11:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24062: Fix the failing test (2.22 KB, patch)
2019-11-19 13:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types (3.09 KB, patch)
2019-11-19 13:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-11-19 09:17:53 UTC
The items are not issued if the patron category's type is 'X', used for statistics.


koha_1       |     #   Failed test 'ISSUED_TO_ANOTHER question flag should be set if AutoReturnCheckedOutItems is disabled and item is checked out to another'
koha_1       |     #   at t/db_dependent/Circulation.t line 1994.
koha_1       |     #          got: undef
koha_1       |     #     expected: '1'
koha_1       |     # Looks like you planned 2 tests but ran 1.
koha_1       |     # Looks like you failed 1 test of 1 run.
koha_1       | 
koha_1       | #   Failed test 'CanBookBeIssued + AutoReturnCheckedOutItems'
koha_1       | #   at t/db_dependent/Circulation.t line 2001.
koha_1       | Can't call method "borrowernumber" on an undefined value at t/db_dependent/Circulation.t line 1998.
Comment 1 Jonathan Druart 2019-11-19 09:22:06 UTC
Created attachment 95524 [details] [review]
Bug 24062: [DO NOT PUSH] Proof

Only apply this patch and confirm the assumption is correct (test was
failing because X was generated for the patron category's type)
Comment 2 Jonathan Druart 2019-11-19 09:22:09 UTC
Created attachment 95525 [details] [review]
Bug 24062: Fix the failing test
Comment 3 Jonathan Druart 2019-11-19 09:22:13 UTC
Created attachment 95526 [details] [review]
Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types

To make sure this kind of random failures will not appear in a future we
are going to fix it at TestBuilder level.

Test plan:
  prove t/db_dependent/TestBuilder.t
and confirm it returns green

You could also only apply the tests against master, run them several
times and confirm that they fail most of the time.
Comment 4 Martin Renvoize 2019-11-19 11:17:46 UTC
Created attachment 95541 [details] [review]
Bug 24062: [DO NOT PUSH] Proof

Only apply this patch and confirm the assumption is correct (test was
failing because X was generated for the patron category's type)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2019-11-19 11:17:49 UTC
Created attachment 95542 [details] [review]
Bug 24062: Fix the failing test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2019-11-19 11:17:52 UTC
Created attachment 95543 [details] [review]
Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types

To make sure this kind of random failures will not appear in a future we
are going to fix it at TestBuilder level.

Test plan:
  prove t/db_dependent/TestBuilder.t
and confirm it returns green

You could also only apply the tests against master, run them several
times and confirm that they fail most of the time.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2019-11-19 11:18:21 UTC
Nice fix, works as expected.. thanks Jonathan.

Signed Off
Comment 8 Marcel de Rooy 2019-11-19 13:30:06 UTC
Looking here now
Comment 9 Marcel de Rooy 2019-11-19 13:46:18 UTC
Created attachment 95549 [details] [review]
Bug 24062: Fix the failing test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2019-11-19 13:46:23 UTC
Created attachment 95550 [details] [review]
Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types

To make sure this kind of random failures will not appear in a future we
are going to fix it at TestBuilder level.

Test plan:
  prove t/db_dependent/TestBuilder.t
and confirm it returns green

You could also only apply the tests against master, run them several
times and confirm that they fail most of the time.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2019-11-19 13:47:32 UTC
Tric with the sub in gen_default has a slight hacky nature, but ok ;)
Comment 12 Jonathan Druart 2019-11-19 14:06:14 UTC
(In reply to Marcel de Rooy from comment #11)
> Tric with the sub in gen_default has a slight hacky nature, but ok ;)

I do not see it hacky but flexible however :) Any suggestions to improve it?
Comment 13 Martin Renvoize 2019-11-19 15:15:58 UTC
Nice work!

Pushed to master for 19.11.00
Comment 14 Victor Grousset/tuxayo 2020-06-11 16:11:09 UTC
Backported to 19.05.x branch for 19.05.12