cargo-nextest JUnit
JUnit XML as written by cargo-nextest ([profile.<name>.junit] in .config/nextest.toml).
Read by pyEDAA.Reports.Unittesting.JUnit.NextestJUnit.Document - see
cargo-nextest JUnit.
Download
Nextest-JUnit.xsd (6.9 kiB)
Validate a report
xmllint --schema Nextest-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 the JUnit XML report written by cargo-nextest (https://github.com/nextest-rs/nextest).
8
9 Derived from the source code of cargo-nextest 0.9.148: the report is assembled in nextest-runner 0.126.0
10 (src/reporter/aggregator/junit.rs) and serialized by quick-junit 0.8.0 (src/serialize.rs,
11 https://github.com/nextest-rs/quick-junit), and checked against reports cargo-nextest wrote.
12
13 An attribute nextest always writes is required, except the run ID (uuid) and the type of a failure, error or
14 skip: the unified data model of pyEDAA.Reports has no field for them, so a report converted from another dialect
15 has neither. Elements and attributes quick-junit offers, but nextest never writes (e.g. disabled, assertions,
16 stackTrace, properties of a testcase), are not allowed.
17 </xsd:documentation>
18 </xsd:annotation>
19
20 <xsd:simpleType name="preservingstring">
21 <xsd:restriction base="xsd:string">
22 <xsd:whiteSpace value="preserve"/>
23 </xsd:restriction>
24 </xsd:simpleType>
25
26 <xsd:simpleType name="uuid">
27 <xsd:restriction base="xsd:string">
28 <xsd:pattern value="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"/>
29 </xsd:restriction>
30 </xsd:simpleType>
31
32 <xsd:simpleType name="duration">
33 <xsd:restriction base="xsd:decimal">
34 <xsd:minInclusive value="0"/>
35 </xsd:restriction>
36 </xsd:simpleType>
37
38 <xsd:complexType name="output">
39 <xsd:simpleContent>
40 <xsd:extension base="preservingstring" />
41 </xsd:simpleContent>
42 </xsd:complexType>
43
44 <xsd:complexType name="status">
45 <xsd:annotation>
46 <xsd:documentation xml:lang="en">The message is the first line of the test's error output, the text all of it.</xsd:documentation>
47 </xsd:annotation>
48 <xsd:simpleContent>
49 <xsd:extension base="preservingstring">
50 <xsd:attribute name="message" type="xsd:string" use="optional" />
51 <xsd:attribute name="type" type="xsd:string" use="optional" />
52 </xsd:extension>
53 </xsd:simpleContent>
54 </xsd:complexType>
55
56 <xsd:complexType name="rerun" mixed="true">
57 <xsd:annotation>
58 <xsd:documentation xml:lang="en">An earlier attempt of a retried test: its error output as text, followed by its captured output.</xsd:documentation>
59 </xsd:annotation>
60 <xsd:sequence>
61 <xsd:element name="system-out" type="output" minOccurs="0" />
62 <xsd:element name="system-err" type="output" minOccurs="0" />
63 </xsd:sequence>
64 <xsd:attribute name="timestamp" type="xsd:dateTime" use="required" />
65 <xsd:attribute name="time" type="duration" use="required" />
66 <xsd:attribute name="message" type="xsd:string" use="optional" />
67 <xsd:attribute name="type" type="xsd:string" use="required" />
68 </xsd:complexType>
69
70 <xsd:complexType name="property">
71 <xsd:attribute name="name" type="xsd:string" use="required" />
72 <xsd:attribute name="value" type="xsd:string" use="required" />
73 </xsd:complexType>
74
75 <xsd:complexType name="properties">
76 <xsd:annotation>
77 <xsd:documentation xml:lang="en">Command, arguments and exported environment variables of a setup script.</xsd:documentation>
78 </xsd:annotation>
79 <xsd:sequence>
80 <xsd:element name="property" type="property" maxOccurs="unbounded" />
81 </xsd:sequence>
82 </xsd:complexType>
83
84 <xsd:complexType name="testcase">
85 <xsd:sequence>
86 <xsd:choice minOccurs="0">
87 <xsd:sequence>
88 <xsd:annotation>
89 <xsd:documentation xml:lang="en">A failed test (or errored, e.g. leaked handles), followed by its retries.</xsd:documentation>
90 </xsd:annotation>
91 <xsd:choice>
92 <xsd:element name="failure" type="status" />
93 <xsd:element name="error" type="status" />
94 </xsd:choice>
95 <xsd:choice minOccurs="0" maxOccurs="unbounded">
96 <xsd:element name="flakyFailure" type="rerun" />
97 <xsd:element name="flakyError" type="rerun" />
98 <xsd:element name="rerunFailure" type="rerun" />
99 <xsd:element name="rerunError" type="rerun" />
100 </xsd:choice>
101 </xsd:sequence>
102 <xsd:element name="skipped" type="status">
103 <xsd:annotation>
104 <xsd:documentation xml:lang="en">A skipped test, written only if the profile's junit.report-skipped selects it.</xsd:documentation>
105 </xsd:annotation>
106 </xsd:element>
107 <xsd:choice maxOccurs="unbounded">
108 <xsd:annotation>
109 <xsd:documentation xml:lang="en">A flaky test, which passed in a retry: its failed attempts.</xsd:documentation>
110 </xsd:annotation>
111 <xsd:element name="flakyFailure" type="rerun" />
112 <xsd:element name="flakyError" type="rerun" />
113 </xsd:choice>
114 </xsd:choice>
115 <xsd:element name="system-out" type="output" minOccurs="0" />
116 <xsd:element name="system-err" type="output" minOccurs="0" />
117 </xsd:sequence>
118 <xsd:attribute name="name" type="xsd:string" use="required" />
119 <xsd:attribute name="classname" type="xsd:string" use="required" />
120 <xsd:attribute name="timestamp" type="xsd:dateTime" use="optional">
121 <xsd:annotation>
122 <xsd:documentation xml:lang="en">Start time of the test; a skipped test has none.</xsd:documentation>
123 </xsd:annotation>
124 </xsd:attribute>
125 <xsd:attribute name="time" type="duration" use="required" />
126 </xsd:complexType>
127
128 <xsd:complexType name="testsuite">
129 <xsd:annotation>
130 <xsd:documentation xml:lang="en">A test binary (named by its binary ID), or a setup script (named @setup-script:...).</xsd:documentation>
131 </xsd:annotation>
132 <xsd:sequence>
133 <xsd:element name="properties" type="properties" minOccurs="0" />
134 <xsd:element name="testcase" type="testcase" minOccurs="0" maxOccurs="unbounded" />
135 </xsd:sequence>
136 <xsd:attribute name="name" type="xsd:string" use="required" />
137 <xsd:attribute name="tests" type="xsd:nonNegativeInteger" use="required" />
138 <xsd:attribute name="skipped" type="xsd:nonNegativeInteger" use="required" />
139 <xsd:attribute name="errors" type="xsd:nonNegativeInteger" use="required" />
140 <xsd:attribute name="failures" type="xsd:nonNegativeInteger" use="required" />
141 </xsd:complexType>
142
143 <xsd:complexType name="testsuites">
144 <xsd:sequence>
145 <xsd:element name="testsuite" type="testsuite" minOccurs="0" maxOccurs="unbounded" />
146 </xsd:sequence>
147 <xsd:attribute name="name" type="xsd:string" use="required" />
148 <xsd:attribute name="tests" type="xsd:nonNegativeInteger" use="required" />
149 <xsd:attribute name="skipped" type="xsd:nonNegativeInteger" use="required" />
150 <xsd:attribute name="failures" type="xsd:nonNegativeInteger" use="required" />
151 <xsd:attribute name="errors" type="xsd:nonNegativeInteger" use="required" />
152 <xsd:attribute name="uuid" type="uuid" use="optional" />
153 <xsd:attribute name="timestamp" type="xsd:dateTime" use="required" />
154 <xsd:attribute name="time" type="duration" use="required" />
155 </xsd:complexType>
156
157 <xsd:element name="testsuites" type="testsuites">
158 <xsd:annotation>
159 <xsd:documentation xml:lang="en">Describes the overall result of all tests of a run.</xsd:documentation>
160 </xsd:annotation>
161 </xsd:element>
162</xsd:schema>