Review main Merged

63700[BUGFIX] Make DateViewHelperTests resilient to execution time

Markus Klein CR +2 V +2 Easy +2 −2 updated 03/15/20, 08:08

Commit message

Executing the tests over midnight caused the changed tests to fail
as those where comparing the "current date" from the test subject
with the one gathered within the tests, those not necessarily
are on the same day.

As the DateViewHelper uses the date from the Context we
safely can use the EXEC_TIME of the Core for the expectation.

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Georg Ringer +1
  • Verified V +2 Done
    • Susi Moog +2
    • Georg Ringer +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 810

  1. Markus Klein uploaded patch set 1 03/13/20, 00:17

  2. TYPO3com voted on patch set 1 V +1 03/13/20, 00:38 Completed build in 21m 11s on Fri, 13 Mar, 12:38 AM Test Summary: 72195 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1311

  3. Georg Ringer voted on patch set 1 V +1 CR +1 03/13/20, 06:30

  4. Mathias Brodala commented on patch set 1 03/13/20, 07:39

    DateViewHelperTest.php:151

    Wouldn't $context->getPropertyFromAspect('date', 'timestamp') be future-proof? Then this doesn't need to be touched anymore if $GLOBALS['EXEC_TIME'] is dropped at some point.
  5. Markus Klein commented on patch set 1 03/13/20, 08:26

    DateViewHelperTest.php:151 Reply

    I consider EXEC_TIME also kind of future-proof. 1) it is simple 2) time is global by definition 3) changing this is a huge thing anyway, so it wouldn't matter to touch one more place.
  6. Markus Klein rebased onto patch set 2 03/13/20, 17:04

  7. TYPO3com voted on patch set 2 V +1 03/13/20, 17:43 Completed build in 32m 08s on Fri, 13 Mar, 05:43 PM Test Summary: 72195 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1326

  8. Georg Ringer voted on patch set 2 V +1 CR +1 03/14/20, 18:44

  9. Susi Moog commented on patch set 2 V +2 CR +2 03/15/20, 08:08

    DateViewHelperTest.php:151 Reply Unresolved

    basically: Mathias is right in the long run. We want to get rid of the globals used (see the usage of the context in the view helper you are testing here) and allow cleanly manipulating the content. However, in this case I'd agree that this would be a bigger change and should probably done at once for all occurences of EXEC_TIME (and ACCESS_TIME if any) that are left - and not in v10. so, let's merge this one like it is.
  10. Susi Moog merged patch set 3 03/15/20, 08:08