Review main Abandoned

76577[TASK] Ensure proper site configuration cleanup in tests

Stefan Bürk CR 0 V 0 Normal +179 −12 updated 11/13/22, 13:04

Commit message

Quite a handful of functional tests are using methods from the
`\TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait`
to write site configurations needed for tests. Nearly all of them
missed properly cleaning up the written configurations, which may
have impact on other tests due not having a clean setup to work
with.

This change adds a convenient method to the `SiteBasedTestTrait`
for proper cleanup and adds them to all tests using this trait
in the `tearDown()` method. `tearDown()` is added in cases where
test did a not had this method yet.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 32

Show 12 more files

Review log 1216

  1. Stefan Bürk uploaded patch set 1 11/12/22, 19:02

  2. core-ci voted on patch set 1 V +1 11/12/22, 19:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33653

  3. Stefan Bürk voted on patch set 1 CR -1 11/12/22, 19:29

  4. Oliver Klee commented on patch set 1 11/12/22, 20:11

    SiteBasedTestTrait.php:321

    I'd find it cleaner if this trait provided the property as a nullable string.
  5. Oliver Klee commented on patch set 1 11/12/22, 21:20

    SiteBasedTestTrait.php:321 Reply

    Ah, this look like it’s about PHPStan complaining about the property not being defined. For this cases, we can add this annotation to the trait to let PHPStan (and human readers) know that this trait is expected to be used in functional tests only: /** * @mixin FunctionalTestCase */
  6. Stefan Bürk commented on patch set 1 11/12/22, 21:28

    SiteBasedTestTrait.php:321 Reply

    I have other issues with this patch still. And there's more why this patch is gonna happen. I have already done some things locally, but still working on it. That check was not about anything, it was because of trait and be save .. other code does not check it all, so the if here will vanish with the next push. So please wait for the next push and use your time for other changes first.
  7. Oliver Klee commented on patch set 1 11/12/22, 21:34

    SiteBasedTestTrait.php:321 Reply

    Ack
  8. Stefan Bürk uploaded patch set 2 11/12/22, 22:18

  9. Stefan Bürk uploaded patch set 3 11/12/22, 22:24

  10. core-ci voted on patch set 2 V +1 11/12/22, 22:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33654

  11. core-ci voted on patch set 3 V +1 11/12/22, 22:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33655

  12. Oliver Klee voted on patch set 3 V +1 11/12/22, 23:09

  13. Oliver Klee commented on patch set 4 11/13/22, 11:46

    Published edit on patch set 3.
  14. Oliver Klee voted on patch set 4 V +1 11/13/22, 11:46

  15. core-ci voted on patch set 4 V +1 11/13/22, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33671

  16. Stefan Bürk abandoned the change 11/13/22, 13:04