run-tests: set attributes in sorted order
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 04 Feb 2019 09:47:13 -0800
changeset 41546 20e62312e016
parent 41545 fbb43514f342
child 41547 f16c03c7a3d7
run-tests: set attributes in sorted order Python 3.8 preserves insertion order in serialized output (https://bugs.python.org/issue34160). Older Pythons serialized in sorted order. Let's make insertion order sorted so behavior is consistent across Python versions. Differential Revision: https://phab.mercurial-scm.org/D5831
tests/run-tests.py
--- a/tests/run-tests.py	Mon Feb 04 09:41:10 2019 -0800
+++ b/tests/run-tests.py	Mon Feb 04 09:47:13 2019 -0800
@@ -2378,12 +2378,12 @@
         timesd = dict((t[0], t[3]) for t in result.times)
         doc = minidom.Document()
         s = doc.createElement('testsuite')
-        s.setAttribute('name', 'run-tests')
-        s.setAttribute('tests', str(result.testsRun))
         s.setAttribute('errors', "0") # TODO
         s.setAttribute('failures', str(len(result.failures)))
+        s.setAttribute('name', 'run-tests')
         s.setAttribute('skipped', str(len(result.skipped) +
                                       len(result.ignored)))
+        s.setAttribute('tests', str(result.testsRun))
         doc.appendChild(s)
         for tc in result.successes:
             t = doc.createElement('testcase')