Skip to content
Snippets Groups Projects
Commit 7d067bb2 authored by Christian Kuhn's avatar Christian Kuhn Committed by Wouter Wolters
Browse files

[BUGFIX] Dependencies between unit tests

Our unit tests have an annoying history of dependencies between
each other: There are tests that rely on global state changes from
other tests. Those are hard and time consuming to track down and
lead to erratic test results if not fixed.

The patch resolves the hopefully last occurences of those cross
dependencies, all of these issues were recently introduced:

* A bug in extbase DebuggerUtility lets a test in core DebugUtilityTest fail
* SchemaColumnDefinitionListenerTest is changed to cope with a possible
  global change by a different test that we can not prevent otherwise
* felogin FrontendLoginControllerTest properly handles registered
  global objects to prevent side effects on TemplateServiceTest

To prevent such issues in the future, the new require-dev dependency
"phpunit-randomizer" is added. It allows running tests in random order
to reveal cross dependencies:

./bin/phpunit-randomizer -c typo3/sysext/core/Build/UnitTests.xml --order rand

Each run echos out a specific seed that can be used to replay this specific
order of tests:

./bin/phpunit-randomizer -c typo3/sysext/core/Build/UnitTests.xml --order rand:1234

The randomizer will be added to the pre-merge tests with a couple of
runs to find those cross dependencies more quickly.

Change-Id: Id08eda19df98f1a8adf25259f852928020acd810
Resolves: #78499
Releases: master
Reviewed-on: https://review.typo3.org/50435


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarDaniel Lorenz <daniel.lorenz@extco.de>
Tested-by: default avatarDaniel Lorenz <daniel.lorenz@extco.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
parent a135a5dd
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment