test/test_collect: fix some timezone dependent tests
This test was using time.strftime which uses the current machine timezone, but collection is done in UTC timezone, so the test was sometimes failing because the strftime('%Y-%m-%d') was another day than the same time in UTC time zone. This test https://erp5js.nexedi.net/#/test_result_module/20210811-96D6B55F/8 for example had the problem. By using faketime and TZ=Europe/Paris environment variable, the same problems reproduced locally 100% of times. The fix is to always use datetime.utcnow().strftime('%Y-%m-%d'), to not depend on the timezone.
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#253788
external
|
SlapOS.Eggs.UnitTest-Jerome.Python2 |
00:22:23
|
||||||
passed |
#253906
external
|
SlapOS.Eggs.UnitTest-Jerome.Python3 |
|
||||||
failed |
#253790
external
retried
|
SlapOS.Eggs.UnitTest-Jerome.Python3 |
00:15:29
|
||||||
failed |
#253900
external
retried
|
SlapOS.Eggs.UnitTest-Jerome.Python3 |
|
||||||
passed |
#253902
external
retried
|
SlapOS.Eggs.UnitTest-Jerome.Python3 |
00:16:05
|
||||||
passed |
#253905
external
retried
|
SlapOS.Eggs.UnitTest-Jerome.Python3 |
|
||||||