Ensure alphabetical order of xml attributes
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 7 May 2020 14:16:08 +0000 (16:16 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 11 May 2020 07:18:18 +0000 (03:18 -0400)
Python 3.8 removed artificial alphabetical ordering
of attributes in ElementTree. The recommended solution
to avoid changes in generated xml is to add attributes
in the alphabetical order directly in the source code.

See https://github.com/python/cpython/commit/63673916464bace8e2147357395fdf3497967ecb

Components: Framework

VK-GL-CTS issue: 2358

Change-Id: Ife4b93a01d76f1f99fcdf2c1d13291ae5c706d85

scripts/mustpass.py

index 1c17273..8c4ae98 100644 (file)
@@ -293,9 +293,9 @@ def genSpecXML (mustpass):
 
                for config in package.configurations:
                        configElem = ElementTree.SubElement(packageElem, "Configuration",
-                                                                                               name                    = config.name,
                                                                                                caseListFile    = getCaseListFileName(package, config),
-                                                                                               commandLine             = getCommandLine(config))
+                                                                                               commandLine             = getCommandLine(config),
+                                                                                               name                    = config.name)
 
        return mustpassElem
 
@@ -314,13 +314,13 @@ def genAndroidTestXml (mustpass):
 
        # add in metadata option for component name
        ElementTree.SubElement(configElement, "option", name="test-suite-tag", value="cts")
-       ElementTree.SubElement(configElement, "option", name="config-descriptor:metadata", key="component", value="deqp")
-       ElementTree.SubElement(configElement, "option", name="config-descriptor:metadata", key="parameter", value="not_instant_app")
-       ElementTree.SubElement(configElement, "option", name="config-descriptor:metadata", key="parameter", value="multi_abi")
-       ElementTree.SubElement(configElement, "option", name="config-descriptor:metadata", key="parameter", value="secondary_user")
+       ElementTree.SubElement(configElement, "option", key="component", name="config-descriptor:metadata", value="deqp")
+       ElementTree.SubElement(configElement, "option", key="parameter", name="config-descriptor:metadata", value="not_instant_app")
+       ElementTree.SubElement(configElement, "option", key="parameter", name="config-descriptor:metadata", value="multi_abi")
+       ElementTree.SubElement(configElement, "option", key="parameter", name="config-descriptor:metadata", value="secondary_user")
        controllerElement = ElementTree.SubElement(configElement, "object")
-       controllerElement.set("type", "module_controller")
        controllerElement.set("class", "com.android.tradefed.testtype.suite.module.TestFailureModuleController")
+       controllerElement.set("type", "module_controller")
        addOptionElement(controllerElement, "screenshot-on-failure", "false")
 
        for package in mustpass.packages: