Bug 19013 - sample_data.sql inserts patrons with guarantorid that do not exist
Summary: sample_data.sql inserts patrons with guarantorid that do not exist
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-31 19:11 UTC by Jonathan Druart
Modified: 2019-10-14 19:56 UTC (History)
4 users (show)

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


Attachments
Bug 19013: Fix borrowers.guarantorid in sammple_patrons.sql (20.51 KB, patch)
2017-07-31 19:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19013: Fix borrowers.guarantorid in sammple_patrons.sql (20.57 KB, patch)
2017-08-07 14:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 19013: (QA followup) Set guarantorid to NULL patron sample data (80.40 KB, patch)
2017-08-07 14:05 UTC, Tomás Cohen Arazi
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-07-31 19:11:41 UTC
MariaDB [koha_kohadev]> select borrowernumber,  guarantorid from borrowers where guarantorid is not null;                                                                    +----------------+-------------+
| borrowernumber | guarantorid |
+----------------+-------------+
|              6 |         102 |
|              7 |         104 |
|              8 |         112 |
|             15 |         131 |
|             18 |         160 |
|             21 |         177 |
|             30 |         254 |
|             35 |         287 |
|             36 |         288 |
|             37 |         289 |
|             40 |         320 |
|             42 |         337 |
+----------------+-------------+

MariaDB [koha_kohadev]> select max(borrowernumber) from borrowers;                                                                                                           
+---------------------+
| max(borrowernumber) |
+---------------------+
|                  50 |
+---------------------+

That breaks randomly tests on Jenkins (Koha/Patrons.t)


    #   Failed test 'new_patron_1 should have 0 guarantee'
    #   at t/db_dependent/Koha/Patrons.t line 85.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'new_patron_1 should have 0 guarantee'
    #   at t/db_dependent/Koha/Patrons.t line 88.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'new_patron_1 should have 2 guarantees'
    #   at t/db_dependent/Koha/Patrons.t line 95.
    #          got: '3'
    #     expected: '2'

    #   Failed test 'new_patron_1 should have 2 guarantees'
    #   at t/db_dependent/Koha/Patrons.t line 98.
    #          got: '3'
    #     expected: '2'
    # Looks like you failed 4 tests of 8.

#   Failed test 'guarantees'
#   at t/db_dependent/Koha/Patrons.t line 100.

#   Failed test 'Delete should have deleted the patron'
#   at t/db_dependent/Koha/Patrons.t line 905.
#          got: '51'
#     expected: '52'
# Looks like you failed 2 tests of 22.
[16:26:26] t/db_dependent/Koha/Patrons.t ................................
Comment 1 Jonathan Druart 2017-07-31 19:14:25 UTC
Created attachment 65374 [details] [review]
Bug 19013: Fix borrowers.guarantorid in sammple_patrons.sql

That breaks randomly tests on Jenkins (Koha/Patrons.t)

It certainly affects data in other languages but I did not find a quick
and easy way to modify this file (replace all guarantorid values with
NULL)
Comment 2 Tomás Cohen Arazi 2017-08-07 14:05:38 UTC
Created attachment 65555 [details] [review]
Bug 19013: Fix borrowers.guarantorid in sammple_patrons.sql

That breaks randomly tests on Jenkins (Koha/Patrons.t)

It certainly affects data in other languages but I did not find a quick
and easy way to modify this file (replace all guarantorid values with
NULL)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Easy fix
Comment 3 Tomás Cohen Arazi 2017-08-07 14:05:47 UTC
Created attachment 65556 [details] [review]
Bug 19013: (QA followup) Set guarantorid to NULL patron sample data

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Jonathan Druart 2017-08-08 12:46:10 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 5 Fridolin Somers 2017-09-29 08:46:04 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 6 Katrin Fischer 2017-10-01 21:16:24 UTC
These patches have been pushed to 16.11.x and will be in 16.11.13.
Comment 7 Mason James 2017-10-24 05:05:20 UTC
Pushed to 16.05.x, for 16.05.18 release