Review main Merged

92508[TASK] Add functional test to ensure integrity of Core fluid templates

Garvin Hicking CR +2 V +2 Normal +133 −0 updated 04/10/26, 07:41

Commit message

With #108770 and #108763 the possibility to validate fluid template
files was added.

We can leverage the same functionality for TYPO3 Core's CI pipeline,
by putting this into a functional test case. For the time being,
it cannot be put inside a pre-flight check like PHPStan and others,
because it requires a working TYPO3 instance for DI and extension
resource management. Luckily, the functional test suite provides
exactly that.

The new test loads all existing core extensions (done just like
in the TCA Schema Analyzer patch). Two test cases cover:

1. No TYPO3 core extension fluid template file may have
   errors. It may have deprecations.

2. A very simple "positive" test for proper error reporting
   is performed. The majority of this is covered in fluid's
   own test cases, though.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Simon Praetorius +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oliver Klee +1
    • Simon Praetorius +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 3

Files 4

Review log 3039

Show 914 earlier messages
  1. Garvin Hicking uploaded patch set 1 01/25/26, 18:49

  2. Garvin Hicking uploaded patch set 2 01/25/26, 18:55

  3. core-ci voted on patch set 1 V -1 01/25/26, 18:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94321

  4. Garvin Hicking uploaded patch set 3 01/25/26, 18:59

  5. Garvin Hicking uploaded patch set 4 01/25/26, 19:00

    Expected red
  6. Garvin Hicking uploaded patch set 5 01/25/26, 19:00

    Expected green
  7. core-ci voted on patch set 2 V -1 01/25/26, 19:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94322

  8. core-ci voted on patch set 3 V +1 01/25/26, 19:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94323

  9. core-ci voted on patch set 5 V +1 01/25/26, 19:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94325

  10. core-ci voted on patch set 4 V -1 01/25/26, 19:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94324

  11. Garvin Hicking commented on patch set 5 01/25/26, 19:22

    See Patchset 4 for an example how a red test with invalid fluid file would look like.
  12. Simon Schaufelberger commented on patch set 5 01/25/26, 20:49

    TemplateAnalyserTest.php:35

    i would give the method some air to breath (add one empty line before).

    TemplateAnalyserTest.php:49

    just a idea: I'm using `.fixture` in Fractor to make it clear that this is a fixture file and not used as original source. Would you find this a good idea?
  13. Garvin Hicking commented on patch set 5 CR -1 01/26/26, 05:45

    TemplateAnalyserTest.php:49 Reply

    I will refactor this to put the actual files in a fixture extension instead, and remove the renaming stuff.
  14. Garvin Hicking uploaded patch set 6 CR -1 V +1 01/26/26, 07:26

    refactor to not copy files around
  1. core-ci voted on patch set 6 V +1 01/26/26, 07:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94337

  2. Garvin Hicking commented on patch set 6 01/26/26, 08:14

    TemplateAnalyserTest.php:35 Reply

    Done

    TemplateAnalyserTest.php:49 Reply

    Done
  3. Oliver Klee commented on patch set 6 01/26/26, 08:37

    TemplateAnalyserTest.php:29

    We're using American English in the Core: ```suggestion final class TemplateAnalyzerTest extends FunctionalTestCase ```
  4. Garvin Hicking commented on patch set 6 01/26/26, 11:45

    TemplateAnalyserTest.php:29 Reply

    There is a mixture of "analyze" and "analyse" in the codebase right now. We should IMO address that in a distinct follow-up patch. The recently introduced method for example is called 'analyse' and only uses 'analyze' as an alias.
  5. Stefan Bürk commented on patch set 6 CR -1 01/26/26, 15:45

    Want to check something, temp -1 on that ...
  6. Stefan Bürk commented on patch set 6 01/26/26, 17:19

    Reply

    .. nevermind.
  7. Stefan Bürk voted on patch set 6 CR 0 01/26/26, 17:23

  8. Oliver Klee voted on patch set 6 V +1 01/26/26, 18:04

  9. Simon Schaufelberger commented on patch set 6 01/26/26, 19:07

    TemplateAnalyserTest.php:46

    this comment is not correct anymore
  10. Garvin Hicking commented on patch set 7 V +1 01/26/26, 20:01

    Published edit on patch set 6.
  11. Garvin Hicking commented on patch set 7 01/26/26, 20:01

    TemplateAnalyserTest.php:46 Reply

    Done
  12. core-ci voted on patch set 7 V +1 01/26/26, 20:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94379

  13. Oliver Klee voted on patch set 7 V +1 01/26/26, 21:12

  14. Simon Schaufelberger voted on patch set 7 CR +1 V +1 01/27/26, 00:00

  15. Garvin Hicking rebased onto patch set 8 CR +1 V +1 04/09/26, 09:42

  16. Simon Praetorius commented on patch set 8 04/09/26, 09:44

    TemplateAnalyserTest.php:117

    Not sure if this survives the rebase. But I'd like to improve this part if possible. Other than that, I'm fine with the patch.
  17. core-ci voted on patch set 8 V -1 04/09/26, 09:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99833

  18. Garvin Hicking uploaded patch set 9 V -1 04/09/26, 18:27

  19. core-ci voted on patch set 9 V +1 04/09/26, 18:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99878

  20. Simon Schaufelberger voted on patch set 9 CR +1 V +1 04/09/26, 18:42

  21. Garvin Hicking commented on patch set 9 04/09/26, 18:46

    TemplateAnalyserTest.php:117 Reply

    Thanks for the feedback @simon@praetorius.me - I adjusted it to the new format. Would that be fine for you?
  22. Oliver Klee voted on patch set 9 V +1 04/10/26, 07:13

  23. Simon Praetorius commented on patch set 9 CR +1 V +1 04/10/26, 07:17

    TemplateAnalyserTest.php:117 Reply

    Done
  24. Garvin Hicking voted on patch set 9 CR +2 V +2 04/10/26, 07:41

  25. Garvin Hicking merged patch set 10 04/10/26, 07:41