Skip to content

Conversation

@tonytw1
Copy link
Contributor

@tonytw1 tonytw1 commented Nov 15, 2025

On a local machine (local LC_TIME="en_GB.UTF-8") FileMetadataReaderTest tests fail occasionally (probably seasonly)

 should read the xmp metadata as stored in the image (process image using GettyImagesGIFT prefix first) *** FAILED ***
[info]   Some("2008-08-19T23:00:00.000Z") was not equal to Some("2008-08-20T00:00:00.000Z") (FileMetadataReaderTest.scala:720)

Fixed by removing a more recent non time zoned date formatter which was shadowing the long standing time zoned date formatter.

Might just be my machine, but the shadowed formatter might be interesting to others.

DateTimeFormat.forPattern("yyyy-MM-dd") matches the same pattern as ISODateTimeFormat.date.withZoneUTC but removes the withZoneUTC behaviour.

Add a British summer time YYYY-MM-dd example to show that this formatter is locale dependant.

I do not know if that was intentional but FileMetadataReaderTest was a long standing test so this could be considered a regression.

Additionally, that entire block of date formatters probably have an indeterminate outcome.

What does this change?

How should a reviewer test this change?

How can success be measured?

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

…emoving non time zoned date formatter which was shadowing the long standing time zoned date formatter.

Add a British summer time YYYY-MM-dd example to show that this formatter is locale dependant.

DateTimeFormat.forPattern("yyyy-MM-dd") matches the same pattern as ISODateTimeFormat.date.withZoneUTC but removes the withZoneUTC behaviour.

I do not know if that was intentional but FileMetadataReaderTest was a long standing test so this could be considered a regression.

Additionally, that entire block of date formatters probably have an indeterminate outcome.
DateTimeFormat.forPattern("yyyy"),
DateTimeFormat.forPattern("yyyy-MM"),
DateTimeFormat.forPattern("yyyy:MM:dd"),
DateTimeFormat.forPattern("yyyy-MM-dd"),
Copy link
Contributor Author

@tonytw1 tonytw1 Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over shadows the UTC timezoned version on line 157?

@tonytw1 tonytw1 marked this pull request as ready for review November 15, 2025 12:55
@tonytw1 tonytw1 requested a review from a team as a code owner November 15, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant