stable

Clone or download

Read-only

fix: Flatten TV3 migration tests to a single test case

Closes request #37944 Flaky TV3 migration tests No functional change. $ make tests-db SEED=1715767234 The command above should pass, same for SEED=1715777716 Why? - Those tests are flaky because they start by a beforeClass method that migrates a TV3 tracker to TV5, and then search again the tracker by its ID. Other tests might be played in-between and might change data, so there is actually no guarantee that the numeric ID will be found again. Instead of doing this, we flatten everything to a single integration test. It was always a single scenario: we migrate the tracker, and then run some assertions on it, this does not change. By doing it in a single test, there are no more interferences from other tests. It also paves the way to running it in a rolled-back transaction, something that cannot be done yet (something in the code commits the transaction). - in PHPUnit assertions, the expectation always comes first in the parameters. I took the opportunity to also add return types, to use stricter assertions and to use self instead of $this for assertion methods. Change-Id: I569a4c33b22061c4cce9cc0d04868502ef9fc62d

Modified Files

Name
M tests/integration/tests/TrackersV3ToV5/DefectTrackerTest.php +176 −181 Go to diff View file
M tests/integration/tests/TrackersV3ToV5/TaskTrackerTest.php +142 −104 Go to diff View file
A tests/lib/Helpers/CodendiLogSwitcher.php +44 −0 Go to diff View file