JunitXml.TestLogger JUnit

JUnit XML as written by the .NET test logger JunitXml.TestLogger (dotnet test --logger junit).

Read by pyEDAA.Reports.Unittesting.JUnit.TestLoggerJUnit.Document - see JunitXml.TestLogger JUnit.

Download

TestLogger-JUnit.xsd (6.8 kiB)

Validate a report

xmllint --schema TestLogger-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			JUnit XML as written by the .NET test logger 'JunitXml.TestLogger' ('dotnet test --logger junit').
  8
  9			Derived from the logger's serializer (spekt/testlogger v8.0.0, 'src/JUnit.Xml.TestLogger/JunitXmlSerializer.cs',
 10			https://github.com/spekt/testlogger) and from reports it wrote. Elements, their order, and the attributes the
 11			logger always writes are required; no other element or attribute is allowed. The logger's options change only
 12			content: 'MethodFormat' the test case's name, 'FailureBodyFormat' the text of a failure, 'StoreConsoleOutput'
 13			whether 'system-out' and 'system-err' are written.
 14		</xsd:documentation>
 15	</xsd:annotation>
 16
 17	<xsd:simpleType name="preservingstring">
 18		<xsd:restriction base="xsd:string">
 19			<xsd:whiteSpace value="preserve"/>
 20		</xsd:restriction>
 21	</xsd:simpleType>
 22
 23	<xsd:simpleType name="timestamp">
 24		<xsd:annotation>
 25			<xsd:documentation xml:lang="en">
 26				Start of the test run in UTC, without fractional seconds and time zone.
 27			</xsd:documentation>
 28		</xsd:annotation>
 29		<xsd:restriction base="xsd:dateTime">
 30			<xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}"/>
 31		</xsd:restriction>
 32	</xsd:simpleType>
 33
 34	<xsd:simpleType name="testcasetime">
 35		<xsd:annotation>
 36			<xsd:documentation xml:lang="en">Duration in seconds with seven decimals, at least 0.0000001.</xsd:documentation>
 37		</xsd:annotation>
 38		<xsd:restriction base="xsd:decimal">
 39			<xsd:pattern value="\d+\.\d{7}"/>
 40			<xsd:minExclusive value="0"/>
 41		</xsd:restriction>
 42	</xsd:simpleType>
 43
 44	<xsd:complexType name="empty"/>
 45
 46	<xsd:complexType name="output">
 47		<xsd:simpleContent>
 48			<xsd:extension base="preservingstring"/>
 49		</xsd:simpleContent>
 50	</xsd:complexType>
 51
 52	<xsd:complexType name="failure">
 53		<xsd:annotation>
 54			<xsd:documentation xml:lang="en">
 55				A failed test: a failed assertion, an exception escaping the test, a time-out or a cancellation. The message is
 56				omitted if the test framework reports none; the text is the stack trace.
 57			</xsd:documentation>
 58		</xsd:annotation>
 59		<xsd:simpleContent>
 60			<xsd:extension base="preservingstring">
 61				<xsd:attribute name="type" type="xsd:string" use="required" fixed="failure"/>
 62				<xsd:attribute name="message" type="xsd:string" use="optional"/>
 63			</xsd:extension>
 64		</xsd:simpleContent>
 65	</xsd:complexType>
 66
 67	<xsd:complexType name="property">
 68		<xsd:attribute name="name" type="xsd:string" use="required"/>
 69		<xsd:attribute name="value" type="xsd:string" use="required"/>
 70	</xsd:complexType>
 71
 72	<xsd:complexType name="properties">
 73		<xsd:annotation>
 74			<xsd:documentation xml:lang="en">A test's traits; one 'property' per value of a trait.</xsd:documentation>
 75		</xsd:annotation>
 76		<xsd:sequence>
 77			<xsd:element name="property" type="property" minOccurs="1" maxOccurs="unbounded"/>
 78		</xsd:sequence>
 79	</xsd:complexType>
 80
 81	<xsd:complexType name="testcase">
 82		<xsd:sequence>
 83			<xsd:choice minOccurs="0">
 84				<xsd:element name="failure" type="failure"/>
 85				<xsd:element name="skipped" type="empty">
 86					<xsd:annotation>
 87						<xsd:documentation xml:lang="en">A skipped test, without the reason.</xsd:documentation>
 88					</xsd:annotation>
 89				</xsd:element>
 90			</xsd:choice>
 91			<xsd:element name="system-out" type="output" minOccurs="0">
 92				<xsd:annotation>
 93					<xsd:documentation xml:lang="en">
 94						The test's standard output, followed by its attachments as '[[ATTACHMENT|path]]'.
 95					</xsd:documentation>
 96				</xsd:annotation>
 97			</xsd:element>
 98			<xsd:element name="system-err" type="output" minOccurs="0"/>
 99			<xsd:element name="properties" type="properties" minOccurs="0"/>
100		</xsd:sequence>
101		<xsd:attribute name="classname" type="xsd:string" use="required">
102			<xsd:annotation>
103				<xsd:documentation xml:lang="en">Namespace and class of the test, separated by a dot.</xsd:documentation>
104			</xsd:annotation>
105		</xsd:attribute>
106		<xsd:attribute name="name" type="xsd:string" use="required">
107			<xsd:annotation>
108				<xsd:documentation xml:lang="en">
109					Method of the test with its arguments, prefixed by the class ('MethodFormat=Class') or the namespace and class
110					('MethodFormat=Full').
111				</xsd:documentation>
112			</xsd:annotation>
113		</xsd:attribute>
114		<xsd:attribute name="time" type="testcasetime" use="required"/>
115	</xsd:complexType>
116
117	<xsd:complexType name="testsuite">
118		<xsd:sequence>
119			<xsd:element name="properties" type="empty"/>
120			<xsd:element name="testcase" type="testcase" minOccurs="1" maxOccurs="unbounded"/>
121			<xsd:element name="system-out" type="output" minOccurs="0">
122				<xsd:annotation>
123					<xsd:documentation xml:lang="en">
124						The test framework's informational messages of the whole test run.
125					</xsd:documentation>
126				</xsd:annotation>
127			</xsd:element>
128			<xsd:element name="system-err" type="output" minOccurs="0">
129				<xsd:annotation>
130					<xsd:documentation xml:lang="en">
131						The test framework's warnings and errors of the whole test run, one per line, prefixed by their level.
132					</xsd:documentation>
133				</xsd:annotation>
134			</xsd:element>
135		</xsd:sequence>
136		<xsd:attribute name="name" type="xsd:string" use="required">
137			<xsd:annotation>
138				<xsd:documentation xml:lang="en">File name of the test assembly.</xsd:documentation>
139			</xsd:annotation>
140		</xsd:attribute>
141		<xsd:attribute name="tests" type="xsd:nonNegativeInteger" use="required"/>
142		<xsd:attribute name="skipped" type="xsd:nonNegativeInteger" use="required"/>
143		<xsd:attribute name="failures" type="xsd:nonNegativeInteger" use="required"/>
144		<xsd:attribute name="errors" type="xsd:nonNegativeInteger" use="required" fixed="0"/>
145		<xsd:attribute name="time" type="xsd:double" use="required">
146			<xsd:annotation>
147				<xsd:documentation xml:lang="en">Sum of the test cases' durations in seconds.</xsd:documentation>
148			</xsd:annotation>
149		</xsd:attribute>
150		<xsd:attribute name="timestamp" type="timestamp" use="required"/>
151		<xsd:attribute name="hostname" type="xsd:string" use="required"/>
152		<xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required" fixed="0"/>
153		<xsd:attribute name="package" type="xsd:string" use="required">
154			<xsd:annotation>
155				<xsd:documentation xml:lang="en">File name of the test assembly, same as 'name'.</xsd:documentation>
156			</xsd:annotation>
157		</xsd:attribute>
158	</xsd:complexType>
159
160	<xsd:complexType name="testsuites">
161		<xsd:sequence>
162			<xsd:element name="testsuite" type="testsuite" minOccurs="0" maxOccurs="unbounded">
163				<xsd:annotation>
164					<xsd:documentation xml:lang="en">The results of one test assembly.</xsd:documentation>
165				</xsd:annotation>
166			</xsd:element>
167		</xsd:sequence>
168	</xsd:complexType>
169
170	<xsd:element name="testsuites" type="testsuites">
171		<xsd:annotation>
172			<xsd:documentation xml:lang="en">The results of a test run, without attributes.</xsd:documentation>
173		</xsd:annotation>
174	</xsd:element>
175</xsd:schema>