Fix code depending on python2 __hash__
With python2, iterating on a dictionary or a set always produces the same result, although this is not a documented behavior. On python3 this is not the case, because the hashing algorithm is random by default, which can also be set using [`PYTHONHASHSEED`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED). On SlapOS, this is done with slapos!1535 This fixes the parts where ERP5 code depends on python2 order, mostly tests, but also places where we iterate on a dictionary or set. Most of the time, the fix has been to sort so that the order is deterministic regardless of the hash algorithm randomization, but sometimes we had to extend a bit the configuration where the order was really important. We did this after discovering the problematic areas by running tests multiple times with different hash randomization seeds. It's not impossible that changing from "default python2 order" to "sorted" reveals some more problems in custom configurations, but this would mean that the configuration must be adjusted to use explicit order instead of being lucky with the default python2 order. The main pattern was the use of `edit` method which edits properties in an order that is a bit constrained with the `edit_order` mechanism, because some properties depend on other properties, so it's important to set them in order. This extends a bit the `edit_order` mechanism to specify more properties that were edited in the right order with `PYTHONHASHSEED=0` by chance. This also extends delivery builders to edit properties in order defined in the equivalence tester, most equivalence tester were already properly configured, except the `start_date` and `stop_date` from delivery level movement groups. That probably only matters for some specific test assertions, but in practice this was visible in a lot of failing tests. Some visible changes are that: - workflows are now sorted alphabetically on history tab - properties are now sorted alphabetically on the diff view of history tab - business templates are installed in the order of dependencies and in alphabetic order when they are not constrained. See merge request !1882
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#660374
external
|
ERP5.CodingStyleTest-Master |
01:09:58
|
||||||
failed |
#660379
external
|
ERP5.UnitTest-Master |
02:31:30
|
||||||
passed |
#660354
external
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:26:35
|
||||||
passed |
#660340
external
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:33:18
|
||||||
failed |
#660390
external
|
Wendelin.UnitTest-Master |
00:44:07
|
||||||
passed |
#660162
external
retried
|
ERP5.CodingStyleTest-Master |
01:31:39
|
||||||
passed |
#660250
external
retried
|
ERP5.CodingStyleTest-Master |
01:31:50
|
||||||
failed |
#660277
external
retried
|
ERP5.CodingStyleTest-Master |
01:24:23
|
||||||
failed |
#660173
external
retried
|
ERP5.UnitTest-Master |
02:33:53
|
||||||
failed |
#660311
external
retried
|
ERP5.UnitTest-Master |
01:38:44
|
||||||
failed |
#660256
external
retried
|
ERP5.UnitTest-Master |
02:35:13
|
||||||
passed |
#660212
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:31:27
|
||||||
passed |
#660303
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:16:51
|
||||||
passed |
#660227
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:22:56
|
||||||
passed |
#660170
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:19:31
|
||||||
passed |
#660293
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:19:01
|
||||||
failed |
#660367
external
retried
|
Wendelin.UnitTest-Master |
01:06:46
|
||||||
failed |
#660178
external
retried
|
Wendelin.UnitTest-Master |
00:12:14
|
||||||
failed |
#660203
external
retried
|
Wendelin.UnitTest-Master |
02:03:11
|
||||||
failed |
#660257
external
retried
|
Wendelin.UnitTest-Master |
00:10:52
|
||||||
failed |
#660260
external
retried
|
Wendelin.UnitTest-Master |
00:11:04
|
||||||
failed |
#660262
external
retried
|
Wendelin.UnitTest-Master |
01:31:37
|
||||||
failed |
#660314
external
retried
|
Wendelin.UnitTest-Master |
00:53:18
|
||||||