Bug 34846 - SIP/ILS.t is failing if the DB has been upgraded
Summary: SIP/ILS.t is failing if the DB has been upgraded
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 34258
Blocks: 34841
  Show dependency treegraph
 
Reported: 2023-09-20 13:36 UTC by Jonathan Druart
Modified: 2024-07-04 20:40 UTC (History)
2 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:
23.11.00,23.05.04,22.11.11
Circulation function:


Attachments
Bug 34846: Fix SIP/ILS.t if DB has been upgraded (1.51 KB, patch)
2023-09-20 14:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34846: Fix SIP/ILS.t if DB has been upgraded (1.56 KB, patch)
2023-09-20 22:01 UTC, David Nind
Details | Diff | Splinter Review
Bug 34846: Fix SIP/ILS.t if DB has been upgraded (1.65 KB, patch)
2023-09-22 08:56 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 2023-09-20 13:36:41 UTC
The number of renewals allowed needs to be mocked/set, or the tests are failing.

To recreate:
root@kohadevbox:koha$ perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

kohadev-koha@kohadevbox:koha$ prove t/db_dependent/SIP/ILS.t
t/db_dependent/SIP/ILS.t .. 14/15 
    #   Failed test 'Renewal succeeded'
    #   at t/db_dependent/SIP/ILS.t line 346.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 1 test of 2.

#   Failed test 'renew'
#   at t/db_dependent/SIP/ILS.t line 348.
# Looks like you failed 1 test of 15.


$transaction->{screen_msg} contains "Item has reached maximum renewals".

Please fix ASAP.
Comment 1 Jonathan Druart 2023-09-20 14:21:22 UTC
Created attachment 155947 [details] [review]
Bug 34846: Fix SIP/ILS.t if DB has been upgraded

t/db_dependent/SIP/ILS.t .. 12/15
    #   Failed test 'Renewal succeeded'
    #   at t/db_dependent/SIP/ILS.t line 346.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 1 test of 2.
t/db_dependent/SIP/ILS.t .. 15/15
 #   Failed test 'renew'
 #   at t/db_dependent/SIP/ILS.t line 348.
 # Looks like you failed 1 test of 15.

Because renewalsallowed is 0 for upgraded DB, when it's 5 for new
install.

We need to set the value.

Test plan:
perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

prove t/db_dependent/SIP/ILS.t
Comment 2 David Nind 2023-09-20 22:01:45 UTC
Created attachment 155962 [details] [review]
Bug 34846: Fix SIP/ILS.t if DB has been upgraded

t/db_dependent/SIP/ILS.t .. 12/15
    #   Failed test 'Renewal succeeded'
    #   at t/db_dependent/SIP/ILS.t line 346.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 1 test of 2.
t/db_dependent/SIP/ILS.t .. 15/15
 #   Failed test 'renew'
 #   at t/db_dependent/SIP/ILS.t line 348.
 # Looks like you failed 1 test of 15.

Because renewalsallowed is 0 for upgraded DB, when it's 5 for new
install.

We need to set the value.

Test plan:
perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

prove t/db_dependent/SIP/ILS.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2023-09-22 08:56:45 UTC
Created attachment 156040 [details] [review]
Bug 34846: Fix SIP/ILS.t if DB has been upgraded

t/db_dependent/SIP/ILS.t .. 12/15
    #   Failed test 'Renewal succeeded'
    #   at t/db_dependent/SIP/ILS.t line 346.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 1 test of 2.
t/db_dependent/SIP/ILS.t .. 15/15
 #   Failed test 'renew'
 #   at t/db_dependent/SIP/ILS.t line 348.
 # Looks like you failed 1 test of 15.

Because renewalsallowed is 0 for upgraded DB, when it's 5 for new
install.

We need to set the value.

Test plan:
perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

prove t/db_dependent/SIP/ILS.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-09-22 13:56:20 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-09-22 19:37:26 UTC
Pushed to 23.05.x for 23.05.04
Comment 6 Jacob O'Mara 2023-10-17 11:04:50 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x