Bug 40379

Summary: t/db_dependent/www tests generate warnings
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: david, fridolin.somers, m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02
Circulation function:
Bug Depends on:    
Bug Blocks: 40444    
Attachments: Bug 40379: Remove warnings from t/db_dependent/www
Bug 40379: Remove warnings from t/db_dependent/www
Bug 40379: Remove warnings from t/db_dependent/www

Description Jonathan Druart 2025-07-15 10:44:44 UTC
03:17:21 koha_1       | Warning: <retrieval> element has non-unique value in 'name' key attribute: F at t/db_dependent/www/auth_values_input_www.t line 36.
03:17:21 koha_1       | Warning: <retrieval> element has non-unique value in 'name' key attribute: B at t/db_dependent/www/auth_values_input_www.t line 36.
Comment 1 Jonathan Druart 2025-07-15 10:50:18 UTC
Created attachment 184081 [details] [review]
Bug 40379: Remove warnings from t/db_dependent/www

XMLin complains because there are several nodes with the same name
attribute. Not sure what is correct or not, but we actually cannot use
the admin/DBMS user to login to the Koha interface.

We use KOHA_USER env var or default to 'koha'.
Comment 2 David Nind 2025-07-18 07:02:47 UTC
Created attachment 184282 [details] [review]
Bug 40379: Remove warnings from t/db_dependent/www

XMLin complains because there are several nodes with the same name
attribute. Not sure what is correct or not, but we actually cannot use
the admin/DBMS user to login to the Koha interface.

We use KOHA_USER env var or default to 'koha'.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2025-07-18 09:18:12 UTC
 t/db_dependent/www/batch.t
1..25
ok 1 - connect to intranet
ok 2 - login to staff interface
ok 3 - load main page
Link not found at /usr/share/koha/t/lib/Mocks/Zebra.pm line 171.
ok 4 - no warnings
# Looks like your test exited with 255 just after 4.
Comment 4 Marcel de Rooy 2025-07-18 09:20:04 UTC
    $agent->follow_link_ok( { url_regex => qr/cataloging-home/i }, 'open caaloging module' );

Whats happening here?
Comment 5 Jonathan Druart 2025-07-18 10:25:50 UTC
(In reply to Marcel de Rooy from comment #3)
>  t/db_dependent/www/batch.t
> 1..25
> ok 1 - connect to intranet
> ok 2 - login to staff interface
> ok 3 - load main page
> Link not found at /usr/share/koha/t/lib/Mocks/Zebra.pm line 171.
> ok 4 - no warnings
> # Looks like your test exited with 255 just after 4.

It's passing for me.

(In reply to Marcel de Rooy from comment #4)
>     $agent->follow_link_ok( { url_regex => qr/cataloging-home/i }, 'open
> caaloging module' );
> 
> Whats happening here?

The test is hitting the mainpage then search for the "Cataloging" link (you should see /cgi-bin/koha/cataloguing/cataloging-home.pl)

What about the other tests? Maybe it's a problem with the changes made here, and the credentials used by the tests to connect to the interface.
Comment 6 Marcel de Rooy 2025-07-21 07:25:32 UTC
(In reply to Jonathan Druart from comment #5)
> (In reply to Marcel de Rooy from comment #3)
> >  t/db_dependent/www/batch.t
> > 1..25
> > ok 1 - connect to intranet
> > ok 2 - login to staff interface
> > ok 3 - load main page
> > Link not found at /usr/share/koha/t/lib/Mocks/Zebra.pm line 171.
> > ok 4 - no warnings
> > # Looks like your test exited with 255 just after 4.
> 
> It's passing for me.
> 
> (In reply to Marcel de Rooy from comment #4)
> >     $agent->follow_link_ok( { url_regex => qr/cataloging-home/i }, 'open
> > caaloging module' );
> > 
> > Whats happening here?
> 
> The test is hitting the mainpage then search for the "Cataloging" link (you
> should see /cgi-bin/koha/cataloguing/cataloging-home.pl)
> 
> What about the other tests? Maybe it's a problem with the changes made here,
> and the credentials used by the tests to connect to the interface.

I am having issues with batch.t and search_utf8.t. The other ones are fine. Still looking..
Comment 7 Marcel de Rooy 2025-07-21 07:51:57 UTC
Created attachment 184423 [details] [review]
Bug 40379: Remove warnings from t/db_dependent/www

XMLin complains because there are several nodes with the same name
attribute. Not sure what is correct or not, but we actually cannot use
the admin/DBMS user to login to the Koha interface.

We use KOHA_USER env var or default to 'koha'.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2025-07-21 07:53:11 UTC
(In reply to Marcel de Rooy from comment #6)
> I am having issues with batch.t and search_utf8.t. The other ones are fine.
> Still looking..

Passing QA. My issues are related to my setup and security. Code looks fine to me, the other ones pass.
Comment 9 Lucas Gass (lukeg) 2025-07-21 20:03:47 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 10 Paul Derscheid 2025-07-24 19:03:44 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 11 Fridolin Somers 2025-08-01 13:41:28 UTC
Does not apply easy on 24.11.x, lets not backport
Comment 12 David Nind 2025-08-29 21:56:03 UTC
Test suite, no changes to the manual required.