Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
junit: fix xml.Name for testsuite properties
TestSuite properties should be `properties` not `property`, we can't unmarshal some junits in the job run uploader currently, it errors out like this: ``` time="2022-07-06T08:01:16Z" level=fatal msg="Command failed" error="[jobrun/release-openshift-ocp-osd-aws-nightly-4.11/1544457393197289472 failed to upload to bigquery: error parsing junit for jobrun/release-openshift-ocp-osd-aws-nightly-4.11/1544457393197289472 \"logs/release-openshift-ocp-osd-aws-nightly-4.11/1544457393197289472/artifacts/install/junit_0zg9j.xml\": testsuiteError=expected element type <testsuite> but have <testsuites> testsuitesError=expected element type <property> but have <properties>, jobrun/release-openshift-ocp-osd-aws-nightly-4.10/1544448209282142208 failed to upload to bigquery: error parsing junit for jobrun/release-openshift-ocp-osd-aws-nightly-4.10/1544448209282142208 \"logs/release-openshift-ocp-osd-aws-nightly-4.10/1544448209282142208/artifacts/install/junit_a75tc.xml\": testsuiteError=expected element type <testsuite> but have <testsuites> testsuitesError=expected element type <property> but have <properties>, jobrun/release-openshift-ocp-osd-gcp-nightly-4.10/154444821514... ``` Per the confusing xml docs[1], we can use the `>` operator to indicate sub-elements: ``` If the XML element contains a sub-element whose name matches the prefix of a tag formatted as "a" or "a>b>c", unmarshal will descend into the XML structure looking for elements with the given names, and will map the innermost elements to that struct field. A tag starting with ">" is equivalent to one starting with the field name followed by ">". ``` [1] https://pkg.go.dev/encoding/xml
- Loading branch information