go-junit-report JUnit

JUnit XML as written by go-junit-report (go-junit-report -in go-test.log -out report.xml). The schema is derived from the structs in go-junit-report’s junit/junit.go.

Read by pyEDAA.Reports.Unittesting.JUnit.GoJUnitReport.Document - see go-junit-report JUnit.

Download

GoJUnitReport-JUnit.xsd (7.3 kiB)

Validate a report

xmllint --schema GoJUnitReport-JUnit.xsd --noout report.xml

Source

  1<?xml version="1.0" encoding="utf-8" ?>
  2<xsd:schema
  3	version="0.1"
  4	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  5	<xsd:annotation>
  6		<xsd:documentation xml:lang="en">
  7			Schema description for JUnit-like unit test summary files written by go-junit-report v2
  8			(https://github.com/jstemmer/go-junit-report). Derived from the structs 'Testsuites', 'Testsuite', 'Testcase',
  9			'Property', 'Result' and 'Output' in 'junit/junit.go' (v2.1.0), which Go's 'encoding/xml' writes in field
 10			order, and from the function 'CreateFromReport' filling them.
 11		</xsd:documentation>
 12	</xsd:annotation>
 13
 14	<xsd:simpleType name="preservingstring">
 15		<xsd:restriction base="xsd:string">
 16			<xsd:whiteSpace value="preserve"/>
 17		</xsd:restriction>
 18	</xsd:simpleType>
 19
 20	<xsd:complexType name="result">
 21		<xsd:annotation>
 22			<xsd:documentation xml:lang="en">
 23				The result of a test (struct 'Result'): its output lines as CDATA.
 24			</xsd:documentation>
 25		</xsd:annotation>
 26		<xsd:simpleContent>
 27			<xsd:extension base="preservingstring">
 28				<xsd:attribute name="message" type="xsd:string" use="required" />
 29				<xsd:attribute name="type" type="xsd:string" use="optional" />
 30			</xsd:extension>
 31		</xsd:simpleContent>
 32	</xsd:complexType>
 33
 34	<xsd:complexType name="output">
 35		<xsd:annotation>
 36			<xsd:documentation xml:lang="en">Output of a test or a package (struct 'Output') as CDATA.</xsd:documentation>
 37		</xsd:annotation>
 38		<xsd:simpleContent>
 39			<xsd:extension base="preservingstring" />
 40		</xsd:simpleContent>
 41	</xsd:complexType>
 42
 43	<xsd:complexType name="property">
 44		<xsd:attribute name="name" type="xsd:string" use="required" />
 45		<xsd:attribute name="value" type="xsd:string" use="required" />
 46	</xsd:complexType>
 47
 48	<xsd:complexType name="properties">
 49		<xsd:sequence>
 50			<xsd:element name="property" type="property" minOccurs="1" maxOccurs="unbounded" />
 51		</xsd:sequence>
 52	</xsd:complexType>
 53
 54	<xsd:complexType name="testcase">
 55		<xsd:sequence>
 56			<xsd:element name="skipped" type="result" minOccurs="0">
 57				<xsd:annotation>
 58					<xsd:documentation xml:lang="en">A skipped test, message 'Skipped'.</xsd:documentation>
 59				</xsd:annotation>
 60			</xsd:element>
 61			<xsd:element name="error" type="result" minOccurs="0">
 62				<xsd:annotation>
 63					<xsd:documentation xml:lang="en">
 64						A build error, a runtime error of the test binary, or a test without a result; messages 'Build error',
 65						'Runtime error', 'No test result found'.
 66					</xsd:documentation>
 67				</xsd:annotation>
 68			</xsd:element>
 69			<xsd:element name="failure" type="result" minOccurs="0">
 70				<xsd:annotation>
 71					<xsd:documentation xml:lang="en">A failed test, message 'Failed'.</xsd:documentation>
 72				</xsd:annotation>
 73			</xsd:element>
 74			<xsd:element name="system-out" type="output" minOccurs="0">
 75				<xsd:annotation>
 76					<xsd:documentation xml:lang="en">The output of a passed test.</xsd:documentation>
 77				</xsd:annotation>
 78			</xsd:element>
 79			<xsd:element name="system-err" type="output" minOccurs="0">
 80				<xsd:annotation>
 81					<xsd:documentation xml:lang="en">
 82						Declared by 'junit.go', not written by 'CreateFromReport'.
 83					</xsd:documentation>
 84				</xsd:annotation>
 85			</xsd:element>
 86		</xsd:sequence>
 87		<xsd:attribute name="name" type="xsd:string" use="required" />
 88		<xsd:attribute name="classname" type="xsd:string" use="required" />
 89		<xsd:attribute name="time" type="xsd:decimal" use="optional" />
 90		<xsd:attribute name="status" type="xsd:string" use="optional">
 91			<xsd:annotation>
 92				<xsd:documentation xml:lang="en">Declared by 'junit.go', not written by 'CreateFromReport'.</xsd:documentation>
 93			</xsd:annotation>
 94		</xsd:attribute>
 95	</xsd:complexType>
 96
 97	<xsd:complexType name="testsuite">
 98		<xsd:sequence>
 99			<xsd:element name="properties" type="properties" minOccurs="0">
100				<xsd:annotation>
101					<xsd:documentation xml:lang="en">
102						Properties given by the options '-p' and '-go-version', and the property 'coverage.statements.pct'.
103					</xsd:documentation>
104				</xsd:annotation>
105			</xsd:element>
106			<xsd:element name="testcase" type="testcase" minOccurs="0" maxOccurs="unbounded">
107				<xsd:annotation>
108					<xsd:documentation xml:lang="en">A test, a subtest or an example.</xsd:documentation>
109				</xsd:annotation>
110			</xsd:element>
111			<xsd:element name="system-out" type="output" minOccurs="0">
112				<xsd:annotation>
113					<xsd:documentation xml:lang="en">
114						Output of the package not belonging to a test, e.g. a panic's stack trace.
115					</xsd:documentation>
116				</xsd:annotation>
117			</xsd:element>
118			<xsd:element name="system-err" type="output" minOccurs="0">
119				<xsd:annotation>
120					<xsd:documentation xml:lang="en">
121						Declared by 'junit.go', not written by 'CreateFromReport'.
122					</xsd:documentation>
123				</xsd:annotation>
124			</xsd:element>
125		</xsd:sequence>
126		<xsd:attribute name="name" type="xsd:string" use="required">
127			<xsd:annotation>
128				<xsd:documentation xml:lang="en">
129					The package's import path; empty if the package's result line wasn't recognized.
130				</xsd:documentation>
131			</xsd:annotation>
132		</xsd:attribute>
133		<xsd:attribute name="tests" type="xsd:nonNegativeInteger" use="required" />
134		<xsd:attribute name="failures" type="xsd:nonNegativeInteger" use="required" />
135		<xsd:attribute name="errors" type="xsd:nonNegativeInteger" use="required" />
136		<xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required">
137			<xsd:annotation>
138				<xsd:documentation xml:lang="en">Index of the test suite in the report, starting at 0.</xsd:documentation>
139			</xsd:annotation>
140		</xsd:attribute>
141		<xsd:attribute name="disabled" type="xsd:nonNegativeInteger" use="optional" />
142		<xsd:attribute name="hostname" type="xsd:string" use="optional">
143			<xsd:annotation>
144				<xsd:documentation xml:lang="en">The host go-junit-report ran on.</xsd:documentation>
145			</xsd:annotation>
146		</xsd:attribute>
147		<xsd:attribute name="package" type="xsd:string" use="optional" />
148		<xsd:attribute name="skipped" type="xsd:nonNegativeInteger" use="optional" />
149		<xsd:attribute name="time" type="xsd:decimal" use="required" />
150		<xsd:attribute name="timestamp" type="xsd:dateTime" use="optional">
151			<xsd:annotation>
152				<xsd:documentation xml:lang="en">The time go-junit-report read the package's result.</xsd:documentation>
153			</xsd:annotation>
154		</xsd:attribute>
155		<xsd:attribute name="file" type="xsd:string" use="optional" />
156	</xsd:complexType>
157
158	<xsd:complexType name="testsuites">
159		<xsd:sequence>
160			<xsd:element name="testsuite" type="testsuite" minOccurs="0" maxOccurs="unbounded">
161				<xsd:annotation>
162					<xsd:documentation xml:lang="en">A Go package.</xsd:documentation>
163				</xsd:annotation>
164			</xsd:element>
165		</xsd:sequence>
166		<xsd:attribute name="name" type="xsd:string" use="optional" />
167		<xsd:attribute name="time" type="xsd:decimal" use="optional" />
168		<xsd:attribute name="tests" type="xsd:nonNegativeInteger" use="optional" />
169		<xsd:attribute name="errors" type="xsd:nonNegativeInteger" use="optional" />
170		<xsd:attribute name="failures" type="xsd:nonNegativeInteger" use="optional" />
171		<xsd:attribute name="skipped" type="xsd:nonNegativeInteger" use="optional" />
172		<xsd:attribute name="disabled" type="xsd:nonNegativeInteger" use="optional" />
173	</xsd:complexType>
174
175	<xsd:element name="testsuites" type="testsuites">
176		<xsd:annotation>
177			<xsd:documentation xml:lang="en">
178				All packages of a 'go test' run. A counter is omitted when it is 0.
179			</xsd:documentation>
180		</xsd:annotation>
181	</xsd:element>
182</xsd:schema>