Bug 29364

Summary: Search.t not reverting changes made to the framework
Product: Koha Reporter: Jonathan Druart <jonathan.druart+koha>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart+koha>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, kyle, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.12
Attachments: Bug 29364: Revert changes to framework visibility made by Search.t

Description Jonathan Druart 2021-10-29 08:31:34 UTC
The tests are playing with the visibility (mss.hidden) of subfields, but does not revert it later. It leads to problem for other tests relying on default data.
Comment 1 Jonathan Druart 2021-10-29 08:32:15 UTC
Found using the diag from

commit c70de8c5305700cce9a6fe9a6f75c2cf53be02f1

    Bug 28445: Add diag for failing test

    Temporary patch to help trying to fix the following random error:
         #   Failed test 'Item types should be sorted by description and an empty entries should be shown'
         #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 121.
         #     Structures begin differing at:
         #          $got->[12] = 'Be9T9FH5aO'
         #     $expected->[12] = 'REF'
         # Looks like you failed 1 test of 2.

     #   Failed test 'itemtypes'
     #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 130.
Comment 2 Jonathan Druart 2021-10-29 08:33:43 UTC
        #   Failed test 'Item types should be sorted by description and an empty entries should be shown'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 127.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = ARRAY(0x557716b68e98)
        # Itemtypes details: $VAR1 = undef;
        # $VAR2 = [
        #           'BK',
        #           'CF',
        #           'CR',
        #           'ihxGmo7',
        #           'MP',
        #           'MU',
        #           'MX',
        #           'REF',
        #           'VM'
        #         ];

        #   Failed test 'Labels should be correctly displayed'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 130.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = HASH(0x557716e2e150)
        # Looks like you failed 2 tests of 2.

    #   Failed test 'itemtypes'
    #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 133.


subfield was hidden and so $subfield->{marc_value}->{values} was empty
Comment 3 Jonathan Druart 2021-10-29 08:42:22 UTC
Created attachment 127080 [details] [review]
Bug 29364: Revert changes to framework visibility made by Search.t

To recreate run:

drop database koha_kohadev;
create database koha_kohadev;

restart_all

KOHA_TESTING=1 prove t/db_dependent/selenium/01-installation.t t/db_dependent/Search.t t/db_dependent/Koha/UI/Form/Builder/Item.t
        #   Failed test 'Item types should be sorted by description and an empty entries should be shown'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 127.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = ARRAY(0x557716b68e98)
        # Itemtypes details: $VAR1 = undef;
        # $VAR2 = [
        #           'BK',
        #           'CF',
        #           'CR',
        #           'ihxGmo7',
        #           'MP',
        #           'MU',
        #           'MX',
        #           'REF',
        #           'VM'
        #         ];

        #   Failed test 'Labels should be correctly displayed'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 130.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = HASH(0x557716e2e150)
        # Looks like you failed 2 tests of 2.

    #   Failed test 'itemtypes'
    #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 133.
Comment 4 Jonathan Druart 2021-10-29 13:48:50 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall 2021-11-05 12:02:33 UTC
Pushed to 21.05.x for 21.05.05
Comment 6 Fridolin Somers 2021-11-11 00:12:04 UTC
Pushed to 20.11.x for 20.11.12
Comment 7 Victor Grousset/tuxayo 2021-11-15 21:34:35 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.