Review main Merged

83630[BUGFIX] Handle roll-over of dates in `RotatingFileWriterTest`

Andreas Kienast CR +2 V +2 Easy +26 −5 updated 03/30/24, 16:26

Commit message

In the test class `RotatingFileWriterTest`, the `MONTHLY` and `YEARLY`
cases for `writingLogWithExpiredLatestRotationInTimeFrameRotates` may
fail as it tries to create a mock file that needs rotation with a
broken date.

It is expected to create a file with a date of the previous period
that's tested. However, at the end of uneven months or each Feb. 29th
this will heavily fail due to PHP's automatic roll-over to the next
valid date. We'd need a fallback to the latest valid date here.

The aforementioned test now has a special handling in place in case
either `MONTHLY` or `YEARLY` are tested – the date is modified to go
back to the first day of the respective period and then either set the
current day OR the latest days in that period, whatever fits.

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1317

  1. Andreas Kienast uploaded patch set 1 03/30/24, 14:33

  2. core-ci voted on patch set 1 V -1 03/30/24, 14:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55088

  3. Andreas Kienast voted on patch set 1 CR -2 03/30/24, 14:47

  4. Andreas Kienast uploaded patch set 2 V -1 03/30/24, 15:49

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  5. Andreas Kienast voted on patch set 2 CR 0 03/30/24, 15:49

  6. Andreas Kienast uploaded patch set 3 03/30/24, 15:54

  7. core-ci voted on patch set 2 V -1 03/30/24, 15:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55089

  8. core-ci voted on patch set 3 V +1 03/30/24, 15:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55090

  9. Nikita Hovratov commented on patch set 3 03/30/24, 16:02

    RotatingFileWriterTest.php:143

    2024-05-12 -1 month -> 2024-05-12
  10. Andreas Kienast commented on patch set 3 03/30/24, 16:04

    RotatingFileWriterTest.php:143 Reply

    D'oh...
  11. Andreas Kienast uploaded patch set 4 V +1 03/30/24, 16:04

  12. Andreas Kienast commented on patch set 4 03/30/24, 16:04

    RotatingFileWriterTest.php:143 Reply

    Done
  13. core-ci voted on patch set 4 V +1 03/30/24, 16:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55091

  14. Nikita Hovratov voted on patch set 4 CR +1 V +1 03/30/24, 16:20

  15. Oliver Klee commented on patch set 4 CR +1 V +1 03/30/24, 16:24

    Thanks for taking care of this!
  16. Nikita Hovratov voted on patch set 4 CR +2 V +2 03/30/24, 16:26

  17. Nikita Hovratov merged patch set 5 03/30/24, 16:26