Bug 32622 - Auth.t failing on D10
Summary: Auth.t failing on D10
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 31908
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-13 11:11 UTC by Jonathan Druart
Modified: 2023-12-28 20:44 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00, 22.11.02, 22.05.09, 21.11.16


Attachments
Bug 32622: Fix Auth.t on D10 (1.69 KB, patch)
2023-01-13 11:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32622: Fix Auth.t on D10 (1.76 KB, patch)
2023-01-13 13:15 UTC, Martin Renvoize
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-01-13 11:11:55 UTC
Caught by Jenkins

15:08:08 koha_1       |     #   Failed test 'While still logged in, relogin with another user'
15:08:08 koha_1       |     #   at t/db_dependent/Auth.t line 219.
15:08:08 koha_1       |     # Looks like you planned 7 tests but ran 6.
15:08:08 koha_1       |     # Looks like you failed 1 test of 6 run.
15:08:08 koha_1       | 
15:08:08 koha_1       | #   Failed test 'checkauth() tests'
15:08:08 koha_1       | #   at t/db_dependent/Auth.t line 331.
15:08:08 koha_1       | Can't locate object method "mock" via package "0" (perhaps you forgot to load "0"?) at t/db_dependent/Auth.t line 176.

The code is:
t/db_dependent/Auth.t
175         my $mock2 = Test::MockModule->new('CGI')     ->mock( 'request_method', 'POST' )
176                                                      ->mock( 'cookie', sub { return $sessionID; } ); # oversimplified..

It's caused by a version mismatch of Test::MockModule with D8, which does not have this commit: https://github.com/geofffranks/test-mockmodule/commit/fef9e742e45e2437e3449eea9970d70555d44bff

We could remove the chaining, or... deactivate D8 builds, which should have been already done actually :)
Comment 1 Jonathan Druart 2023-01-13 11:12:37 UTC
Hey, it's D10, sorry!
Comment 2 Jonathan Druart 2023-01-13 11:16:21 UTC
Created attachment 145262 [details] [review]
Bug 32622: Fix Auth.t on D10

It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: https://github.com/geofffranks/test-mockmodule/commit/fef9e742e45e2437e3449eea9970d70555d44bff

We should remove the chaining here.

Test plan:
Confirm that Auth.t still pass, and is fixed on D10
Comment 3 Martin Renvoize 2023-01-13 13:13:22 UTC
Nice work Joubu!
Comment 4 Martin Renvoize 2023-01-13 13:15:05 UTC
Created attachment 145270 [details] [review]
Bug 32622: Fix Auth.t on D10

It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: https://github.com/geofffranks/test-mockmodule/commit/fef9e742e45e2437e3449eea9970d70555d44bff

We should remove the chaining here.

Test plan:
Confirm that Auth.t still pass, and is fixed on D10

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2023-01-13 13:15:51 UTC
Works perfectly, Passing QA
Comment 6 Martin Renvoize 2023-01-13 16:56:33 UTC
I'm a Muppet.. I forgot to update bugzilla that this is in master too... 😀
Comment 7 Lucas Gass 2023-01-17 21:08:38 UTC
Backported to 22.05.x for upcoming 22.05.09
Comment 8 Arthur Suzuki 2023-01-26 09:05:20 UTC
pushed to 21.11.x for 21.11.16
Comment 9 wainuiwitikapark 2023-03-15 01:26:45 UTC
Not backported to 21.05.x