-
- Downloads
[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:TYPO3com <no-reply@typo3.com> Reviewed-by:
Markus Klein <markus.klein@typo3.org> Reviewed-by:
Daniel Lorenz <daniel.lorenz@extco.de> Tested-by:
Daniel Lorenz <daniel.lorenz@extco.de> Reviewed-by:
Wouter Wolters <typo3@wouterwolters.nl> Tested-by:
Wouter Wolters <typo3@wouterwolters.nl>
Showing
- composer.json 2 additions, 1 deletioncomposer.json
- composer.lock 49 additions, 2 deletionscomposer.lock
- typo3/sysext/core/Tests/Unit/Database/Schema/EventListener/SchemaColumnDefinitionListenerTest.php 10 additions, 2 deletions...hema/EventListener/SchemaColumnDefinitionListenerTest.php
- typo3/sysext/core/Tests/Unit/FormProtection/FormProtectionFactoryTest.php 0 additions, 4 deletions...e/Tests/Unit/FormProtection/FormProtectionFactoryTest.php
- typo3/sysext/core/Tests/Unit/Utility/DebugUtilityTest.php 7 additions, 7 deletionstypo3/sysext/core/Tests/Unit/Utility/DebugUtilityTest.php
- typo3/sysext/extbase/Classes/Utility/DebuggerUtility.php 4 additions, 0 deletionstypo3/sysext/extbase/Classes/Utility/DebuggerUtility.php
- typo3/sysext/extbase/Tests/Unit/Utility/DebuggerUtilityTest.php 2 additions, 12 deletions...sysext/extbase/Tests/Unit/Utility/DebuggerUtilityTest.php
- typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php 19 additions, 0 deletions...gin/Tests/Unit/Controller/FrontendLoginControllerTest.php
Loading
Please register or sign in to comment