Commit Graph

4 Commits

Author SHA1 Message Date
jnahmias 83a8415d99 Use assertEqualsWithDelta() to test time_spent
Timing, clock skew, and network conditions can cause slight skew in the generated/expected timestamps in the unit test vs. actual recorded timestamps in the database. This can cause flakiness in the tests due to sporadic failures when things don't perfectly align. To fix this, we change assertEquals() to assertEqualsWithDelta() with a small (3 second) delta to account for this potential delay.
2023-02-16 18:23:20 -08:00
Christoph Reiter 0b8a270bbb tests: port assertEquals() with delta to assertEqualsWithDelta()
assertEquals() in phpunit 9.5 no longer takes a delta parameter
and has assertEqualsWithDelta() as a replacement. This means
float get compared without a delta atm, and a recent phpunit
release (9.5.25) has made float comparisons stricter resulting in
test suite errors such as:

1) SubtaskTimeTrackingModelTest::testCalculateSubtaskTime
Total spent
Failed asserting that 3.3000000000000003 matches expected 3.3.
tests/units/Model/SubtaskTimeTrackingModelTest.php:186

This replaces all assertEquals() calls that pass a delta value
with assertEqualsWithDelta().
2022-10-10 18:57:22 -07:00
Frederic Guillot 14713b0ec7 Rename all models 2016-05-28 19:48:22 -04:00
Frederic Guillot 6ef83d0e05 Add unit test for transition model 2016-02-29 22:40:26 -05:00