Bug 31201

Summary: Pseudonymization.t failing if selenium/patrons_search.t failed before
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: lucas, martin.renvoize, tomascohen, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00,21.11, 22.05.05
Circulation function:
Bug Depends on:    
Bug Blocks: 25551    
Attachments: Bug 31201: Prevent Pseudonymization.t to fail
Bug 31201: Prevent Pseudonymization.t to fail
Bug 31201: Prevent Pseudonymization.t to fail

Description Jonathan Druart 2022-07-20 15:45:14 UTC
Koha_Master/2115

19:52:29 koha_1       | #   Failed test 'No tests run for subtest "PseudonymizedBorrowerAttributes tests"'
19:52:29 koha_1       | #   at t/db_dependent/Koha/Pseudonymization.t line 211.
19:52:29 koha_1       | Duplicate ID# Looks like your test exited with 255 just after 3.
Comment 1 Jonathan Druart 2022-07-20 15:46:19 UTC
Created attachment 137938 [details] [review]
Bug 31201: Prevent Pseudonymization.t to fail

It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly
Comment 2 Tomás Cohen Arazi (tcohen) 2022-07-20 17:45:04 UTC
It is actually failing randomly, with this patch at least:

$ prove t/db_dependent/Koha/Pseudonymization.t
t/db_dependent/Koha/Pseudonymization.t .. 1/3 
    #   Failed test 'Attribute 1 should be retrieved correctly'
    #   at t/db_dependent/Koha/Pseudonymization.t line 201.
    #     Structures begin differing at:
    #          $got->{code} = 'sJHyWk'
    #     $expected->{code} = 'YgXf22O9Vp'

    #   Failed test 'Attribute 2 should be retrieved correctly'
    #   at t/db_dependent/Koha/Pseudonymization.t line 207.
    #     Structures begin differing at:
    #          $got->{attribute} = 'attribute for code1'
    #     $expected->{attribute} = 'attribute for code3'
    # Looks like you failed 2 tests of 3.
t/db_dependent/Koha/Pseudonymization.t .. 3/3 
#   Failed test 'PseudonymizedBorrowerAttributes tests'
#   at t/db_dependent/Koha/Pseudonymization.t line 214.
# Looks like you failed 1 test of 3.
Comment 3 Jonathan Druart 2022-07-21 05:18:29 UTC
Created attachment 137952 [details] [review]
Bug 31201: Prevent Pseudonymization.t to fail

It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly
Comment 4 Martin Renvoize (ashimema) 2022-07-21 07:16:04 UTC
Created attachment 137954 [details] [review]
Bug 31201: Prevent Pseudonymization.t to fail

It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2022-07-21 07:16:39 UTC
The change makes sense to me and makes us a little more future proof by using testbuilder.

Passing QA
Comment 6 Tomás Cohen Arazi (tcohen) 2022-07-21 12:49:35 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass (lukeg) 2022-09-02 14:34:56 UTC
Backported to 22.05.x for 22.05.05
Comment 8 Arthur Suzuki 2022-09-14 12:59:18 UTC
Thanks!

Pushed to 21.11 for 21.11.12
Comment 9 Victor Grousset/tuxayo 2022-09-19 20:16:43 UTC
Not backported to oldoldstable (21.05.x). No recollection of this failing on 21.05.x, will keep in mind if Pseudonymization.t fails.

Nothing to document, resolving