Bug 26589 - t/db_dependent/OAI/Sets.t unit test fails due to OAI-PMH:AutoUpdateSets syspref
Summary: t/db_dependent/OAI/Sets.t unit test fails due to OAI-PMH:AutoUpdateSets syspref
Status: Pushed to oldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25460
  Show dependency treegraph
 
Reported: 2020-10-01 04:42 UTC by Alex Buckley
Modified: 2020-11-17 09:41 UTC (History)
3 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06, 19.11.12, 19.05.17


Attachments
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled (3.30 KB, patch)
2020-10-01 23:33 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled (3.34 KB, patch)
2020-10-02 09:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled (3.40 KB, patch)
2020-10-13 11:44 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2020-10-01 04:42:34 UTC
When the  OAI-PMH:AutoUpdateSets syspref is disabled the t/db_dependent/OAI/Sets.t unit tests all pass successfully. 

But when the syspref is enabled then the unit test fail with this error:

t/db_dependent/OAI/Sets.t .. 1/147 C4::OAI::Sets::AddOAISetsBiblios(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry '39-46' for key 'PRIMARY' [for Statement "
        INSERT INTO oai_sets_biblios (set_id, biblionumber)
        VALUES (?,?)
    " with ParamValues: 0='46', 1=39] at t/db_dependent/OAI/Sets.t line 372
# Looks like your test exited with 255 just after 100.
t/db_dependent/OAI/Sets.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 47/147 subtests
Comment 1 Alex Buckley 2020-10-01 23:33:20 UTC
Created attachment 111050 [details] [review]
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled

Test plan:
1. Check the OAI-PMH:AutoUpdateSets syspref is disabled
2. Run t/db_dependent/OAI/Sets.t tests and confirm tests pass
successfully
3. Enabled the OAI-PMH:AutoUpdateSets syspref
4. Repeat step 2 and confirm the tests fail

5. Apply this patch and restart plack: sudo koha-plack --restart
<instance>
6. Repeat step 2 and confirm the tests now pass
7. Disable the OAI-PMH:AutoUpdateSets syspref and repeat step 2 and
confirm tests still pass

Sponsored-By: Catalyst IT
Comment 2 David Nind 2020-10-02 09:43:30 UTC
Created attachment 111078 [details] [review]
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled

Test plan:
1. Check the OAI-PMH:AutoUpdateSets syspref is disabled
2. Run t/db_dependent/OAI/Sets.t tests and confirm tests pass
successfully
3. Enabled the OAI-PMH:AutoUpdateSets syspref
4. Repeat step 2 and confirm the tests fail

5. Apply this patch and restart plack: sudo koha-plack --restart
<instance>
6. Repeat step 2 and confirm the tests now pass
7. Disable the OAI-PMH:AutoUpdateSets syspref and repeat step 2 and
confirm tests still pass

Sponsored-By: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2020-10-13 11:44:58 UTC
Created attachment 111538 [details] [review]
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled

Test plan:
1. Check the OAI-PMH:AutoUpdateSets syspref is disabled
2. Run t/db_dependent/OAI/Sets.t tests and confirm tests pass
successfully
3. Enabled the OAI-PMH:AutoUpdateSets syspref
4. Repeat step 2 and confirm the tests fail

5. Apply this patch and restart plack: sudo koha-plack --restart
<instance>
6. Repeat step 2 and confirm the tests now pass
7. Disable the OAI-PMH:AutoUpdateSets syspref and repeat step 2 and
confirm tests still pass

Sponsored-By: Catalyst IT

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-10-14 12:55:27 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass 2020-11-10 22:57:35 UTC
backported to 20.05.x for 20.05.06
Comment 6 Aleisha Amohia 2020-11-17 03:55:00 UTC
backported to 19.11.x for 19.11.12
Comment 7 Victor Grousset/tuxayo 2020-11-17 09:41:14 UTC
Backported to 19.05.x branch for 19.05.17