Bug 19403 - Again and again, Circulation.t is failing randomly
Summary: Again and again, Circulation.t is failing randomly
Status: Pushed to Master
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: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 19009
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-03 17:11 UTC by Jonathan Druart
Modified: 2017-10-12 14:20 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19403: Add some default values when building patrons for test (934 bytes, patch)
2017-10-03 17:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19403: Prevent Circulation.t to fail randomly (17.70 KB, patch)
2017-10-03 17:36 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 2017-10-03 17:11:49 UTC
#   Failed test 'No error or alert should be raised'
    #   at t/db_dependent/Circulation.t line 1553.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'BIBLIO_ALREADY_ISSUED question flag should be set if AllowMultipleIssuesOnABiblio=0 and issue already exists'
    #   at t/db_dependent/Circulation.t line 1554.
    #          got: undef
    #     expected: '1'

    #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if AllowMultipleIssuesOnABiblio=1'
    #   at t/db_dependent/Circulation.t line 1558.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if it is a subscription'
    #   at t/db_dependent/Circulation.t line 1565.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if it is a subscription'
    #   at t/db_dependent/Circulation.t line 1569.
    #          got: '1'
    #     expected: '0'
    # Looks like you failed 5 tests of 5.

#   Failed test 'CanBookBeIssued + AllowMultipleIssuesOnABiblio'
#   at t/db_dependent/Circulation.t line 1570.
# Looks like you failed 1 test of 102.
[15:00:27] t/db_dependent/Circulation.t ...................................
Comment 1 Jonathan Druart 2017-10-03 17:36:32 UTC
Created attachment 67565 [details] [review]
Bug 19403: Add some default values when building patrons for test

To avoid some tests to fail randomly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 2 Jonathan Druart 2017-10-03 17:36:37 UTC
Created attachment 67566 [details] [review]
Bug 19403: Prevent Circulation.t to fail randomly

Due to the number of test cases handle by CanBookBeIssued, Circulation.t
fails randomly. To prevent that it is better to set some values.
For instance if the patron is a statistical patron (category_type=X),
the subroutine will return a STATS flag.

This patch also adds a subroutine to the test file to display the keys
of $error, $question and $alert set by CanBookBeIssued.
It will be easier to track other random failures.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2017-10-03 17:37:33 UTC
Pushed to master for 17.11.