Bug 19985 - TestBuilder.t fails if default circ rule exists
Summary: TestBuilder.t fails if default circ rule exists
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-16 18:35 UTC by Nick Clemens
Modified: 2019-10-14 19:58 UTC (History)
3 users (show)

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


Attachments
Bug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty (1.29 KB, patch)
2018-01-22 20:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty (1.33 KB, patch)
2018-01-23 02:37 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-01-16 18:35:18 UTC
Set a default circ rule

vagrant@kohadevbox:kohaclone(BUGFUN)$ prove t/db_dependent/TestBuilder.t
t/db_dependent/TestBuilder.t .. 1/13 Violation of unique constraint in DefaultCircRule at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 241.

    #   Failed test 'TestBuilder should be able to create an object for every source'
    #   at t/db_dependent/TestBuilder.t line 78.
    #          got: '1'
    #     expected: '0'
    # The following sources have not been generated correctly: DefaultCircRule
    # Looks like you failed 1 test of 1.
t/db_dependent/TestBuilder.t .. 3/13 
#   Failed test 'Build all sources'
#   at t/db_dependent/TestBuilder.t line 84.
t/db_dependent/TestBuilder.t .. 12/13 # Looks like you failed 1 test of 13.
t/db_dependent/TestBuilder.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/13 subtests
Comment 1 Jonathan Druart 2018-01-22 20:21:51 UTC
Created attachment 70812 [details] [review]
Bug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty

This table cannot contain more than 1 row, so we need to remove its data
before trying to generate a new entry.

Test plan:
Set a default circ rule
 prove t/db_dependent/TestBuilder.t
should return green

Without this patch you get:
    #   Failed test 'TestBuilder should be able to create an object for every source'
    #   at t/db_dependent/TestBuilder.t line 78.
    #          got: '1'
    #     expected: '0'
    # The following sources have not been generated correctly: DefaultCircRule
    # Looks like you failed 1 test of 1.
Comment 2 Mark Tompsett 2018-01-23 02:37:31 UTC
Created attachment 70817 [details] [review]
Bug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty

This table cannot contain more than 1 row, so we need to remove its data
before trying to generate a new entry.

Test plan:
Set a default circ rule
 prove t/db_dependent/TestBuilder.t
should return green

Without this patch you get:
    #   Failed test 'TestBuilder should be able to create an object for every source'
    #   at t/db_dependent/TestBuilder.t line 78.
    #          got: '1'
    #     expected: '0'
    # The following sources have not been generated correctly: DefaultCircRule
    # Looks like you failed 1 test of 1.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 3 Jonathan Druart 2018-01-23 19:07:46 UTC
Trivial, skipping QA.
Comment 4 Marcel de Rooy 2018-01-26 06:47:31 UTC
(In reply to Jonathan Druart from comment #3)
> Trivial, skipping QA.

Please adjust status if you do so. This has been pushed while still in the signoff queue. Thanks.
Comment 5 Nick Clemens 2018-02-02 17:02:52 UTC
Awesome work all! Pushed to stable for 17.11.03
Comment 6 Fridolin Somers 2018-02-08 09:52:37 UTC
Pushed to 17.05.x for v17.05.09