Bug 24144

Summary: regressions.t tests have not been updated after bug 23836
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, kyle, lucas, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.01
Bug Depends on: 23836    
Bug Blocks:    
Attachments: Bug 24144: (bug 23836 follow-up) Fix regressions.t tests
Bug 24144: (bug 23836 follow-up) Fix regressions.t tests

Description Jonathan Druart 2019-12-02 16:11:55 UTC
t/db_dependent/www/regressions.t ..
    #   Failed test '302 for biblionumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 105.
    #          got: '404'
    #     expected: '302'

    #   Failed test '302 for itemnumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 109.
    #          got: '404'
    #     expected: '302'

    #   Failed test '302 for biblionumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 120.
    #          got: '404'
    #     expected: '302'

    #   Failed test '302 for itemnumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 124.
    #          got: '404'
    #     expected: '302'

    #   Failed test '302 for biblionumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 135.
    #          got: '404'
    #     expected: '302'

    #   Failed test '302 for itemnumber with matching URI'
    #   at t/db_dependent/www/regressions.t line 139.
    #          got: '404'
    #     expected: '302'
    # Looks like you failed 6 tests of 36.
t/db_dependent/www/regressions.t .. 1/1 
#   Failed test 'open redirection vulnerabilities in tracklinks'
#   at t/db_dependent/www/regressions.t line 141.
Comment 1 Jonathan Druart 2019-12-02 16:13:58 UTC
Created attachment 95928 [details] [review]
Bug 24144: (bug 23836 follow-up) Fix regressions.t tests

Bug 24144 changes the behavior for tracklinks.pl but did not adjust the
tests.

We must then expect 404 if the pref is turned off.
Also mock_preference cannot work (we are hitting the web server and so
need to set the value in DB and flush the L1 caches)
Comment 2 Martin Renvoize 2019-12-02 16:23:27 UTC
Created attachment 95929 [details] [review]
Bug 24144: (bug 23836 follow-up) Fix regressions.t tests

Bug 23836 changes the behavior for tracklinks.pl but did not adjust the
tests.

We must then expect 404 if the pref is turned off.
Also mock_preference cannot work (we are hitting the web server and so
need to set the value in DB and flush the L1 caches)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2019-12-02 16:23:54 UTC
Thanks for the quick fix Jonathan, Passing QA and Pushing
Comment 4 Martin Renvoize 2019-12-02 17:19:33 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Lucas Gass 2019-12-13 16:59:36 UTC
backported to 19.11.x for 19.11.01
Comment 6 Lucas Gass 2019-12-13 16:59:55 UTC
backported to 19.05.x for 19.05.06