Bug 38216 - Objects.t failing on D10 and U20
Summary: Objects.t failing on D10 and U20
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Chris Cormack
QA Contact: Testopia
URL:
Keywords:
Depends on: 37902
Blocks:
  Show dependency treegraph
 
Reported: 2024-10-21 09:04 UTC by Jonathan Druart
Modified: 2024-10-21 13:19 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-10-21 09:04:52 UTC
t/db_dependent/Koha/REST/Plugin/Objects.t .. 18/18 
#   Failed test 'No tests run for subtest "date handling"'
#   at t/db_dependent/Koha/REST/Plugin/Objects.t line 1041.
Can't locate object method "rfc3339" via package "DateTime" at t/db_dependent/Koha/REST/Plugin/Objects.t line 1024.
# Looks like your test exited with 255 just after 18.
t/db_dependent/Koha/REST/Plugin/Objects.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Comment 1 Jonathan Druart 2024-10-21 09:08:41 UTC
DateTime->rfc3339 has been added to DateTime 1.53

https://github.com/houseabsolute/DateTime.pm/blob/master/Changes
"""
1.53   2020-11-08
- Added a $dt->rfc3339 method. Based on discussion in GH #109 by worthmine.
"""

D10 has 1.50
U20 has 1.51

D10 - "Buster also has benefited from Long Term Support (LTS) until 30th June, 2024."

Ubuntu 20.04 Focal has standard support until April 2025
Comment 2 Jonathan Druart 2024-10-21 09:09:44 UTC
Only the tests are failing.

We could add a silly test to skip those tests if DateTime does not have rfc3339.

Another, better, idea?
Comment 3 Katrin Fischer 2024-10-21 11:54:32 UTC
So the Debian version is end of life and the Ubuntu has a bit more support to go, right? So we don't need to worry about Debian then.

What happens in the GUI if one encounters one of these cases?

And should we mark the patches for not backporting to stable releases?
Comment 4 Jonathan Druart 2024-10-21 12:39:04 UTC
(In reply to Katrin Fischer from comment #3)
> So the Debian version is end of life and the Ubuntu has a bit more support
> to go, right? So we don't need to worry about Debian then.
> 
> What happens in the GUI if one encounters one of these cases?

By "Only the tests are failing." I meant that this only impacts the tests. Nothing else if using ->rfc3339 *yet*.

> And should we mark the patches for not backporting to stable releases?

I don't think it should be backported too fast anyway.
Comment 5 Katrin Fischer 2024-10-21 12:44:10 UTC
Isn't Bug 37905 - Correctly fix the "last hour" filter on the job list using it?
Comment 6 Jonathan Druart 2024-10-21 12:59:29 UTC
(In reply to Katrin Fischer from comment #5)
> Isn't Bug 37905 - Correctly fix the "last hour" filter on the job list using
> it?

Where?

There are only 2 occurrences

% git grep '\->rfc3339'
t/db_dependent/Koha/REST/Plugin/Objects.t:    my $q = encode_json( { enqueued_on => $one_hour_ago->rfc3339, borrowernumber => $patron->id } );
t/db_dependent/Koha/REST/Plugin/Objects.t:            enqueued_on    => [ { '>' => $now->rfc3339 }, { '=' => $one_hour_ago->rfc3339 } ],
Comment 7 Katrin Fischer 2024-10-21 13:06:46 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to Katrin Fischer from comment #5)
> > Isn't Bug 37905 - Correctly fix the "last hour" filter on the job list using
> > it?
> 
> Where?
> 
> There are only 2 occurrences
> 
> % git grep '\->rfc3339'
> t/db_dependent/Koha/REST/Plugin/Objects.t:    my $q = encode_json( {
> enqueued_on => $one_hour_ago->rfc3339, borrowernumber => $patron->id } );
> t/db_dependent/Koha/REST/Plugin/Objects.t:            enqueued_on    => [ {
> '>' => $now->rfc3339 }, { '=' => $one_hour_ago->rfc3339 } ],

Interesting, it was a dependency, I hadn't check the code (too busy today)
Comment 8 Jonathan Druart 2024-10-21 13:15:45 UTC
Bug 37902 fixed the tz handling server-side.
Bug 37905 corrected how to request the server (using a rfc3339 formatted date).

The DateTime->rfc3339 method is only used in tests for comparison.
Comment 9 Katrin Fischer 2024-10-21 13:19:29 UTC
(In reply to Jonathan Druart from comment #8)
> Bug 37902 fixed the tz handling server-side.
> Bug 37905 corrected how to request the server (using a rfc3339 formatted
> date).
> 
> The DateTime->rfc3339 method is only used in tests for comparison.

"Fixing" the tests for now seems valid then. But maybe we should add some kind of note to not use it ... before 25.05? Strange situation.