-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open test reporting XML format enabled doesn't work #4313
Comments
I'm unable to reproduce this. Could you please share a full example? Did a partial |
yes <?xml version="1.0" ?>
<e:events xmlns="https://schemas.opentest4j.org/reporting/core/0.1.0"
xmlns:e="https://schemas.opentest4j.org/reporting/events/0.1.0"
xmlns:java="https://schemas.opentest4j.org/reporting/java/0.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<infrastructure>
<hostName>foo</hostName>
<userName>bar</userName>
<operatingSystem>Mac OS X</operatingSystem>
<cpuCores>10</cpuCores>
<java:javaVersion>23.0.2</java:javaVersion>
<java:fileEncoding>UTF-8</java:fileEncoding>
<java:heapSize max="8589934592"></java:heapSize>
</infrastructure> |
test method example @TestFactory
Stream<DynamicTest> generateDynamicTests() {
List<String> values = List.of("Test A", "Test B", "Test C");
return IntStream.range(0, values.size()).mapToObj(index -> {
String testName = "Test-" + index + " [" + values.get(index) + "]";
return dynamicTest(testName, () -> {
assertTrue(values.get(index).startsWith("Test"));
});
});
} run command java -jar build/junit-platform-console-standalone-1.11.4.jar execute \
--classpath build/libs/tests.jar \
--select-class=foo.bar.TestNameClass --include-classname=.* \
--disable-ansi-colors --details-theme=unicode --disable-banner \
--config=junit.platform.reporting.open.xml.enabled=true \
--single-color --details=flat --include-engine=junit-jupiter --reports-dir $TEST_ARTIFACTS |
legacy xml report is fine <testcase name="generateDynamicTests()[1]" classname="foo.bar.TestNameClass" time="0.002">
<system-out><![CDATA[
unique-id: [engine:junit-jupiter]/[class:foo.bar.TestNameClass]/[test-factory:generateDynamicTests()]/[dynamic-test:#1]
display-name: Test-0 [Test A]
]]></system-out>
</testcase>
<testcase name="generateDynamicTests()[3]" classname="foo.bar.TestNameClass" time="0">
<system-out><![CDATA[
unique-id: [engine:junit-jupiter]/[class:foo.bar.TestNameClass]/[test-factory:generateDynamicTests()]/[dynamic-test:#3]
display-name: Test-2 [Test C]
]]></system-out>
</testcase>
<testcase name="generateDynamicTests()[2]" classname="foo.bar.TestNameClass" time="0">
<system-out><![CDATA[
unique-id: [engine:junit-jupiter]/[class:foo.bar.TestNameClass]/[test-factory:generateDynamicTests()]/[dynamic-test:#2]
display-name: Test-1 [Test B]
]]></system-out>
</testcase> |
That produces this for me: <?xml version="1.0" ?>
<e:events xmlns="https://schemas.opentest4j.org/reporting/core/0.1.0" xmlns:e="https://schemas.opentest4j.org/reporting/events/0.1.0" xmlns:java="https://schemas.opentest4j.org/reporting/java/0.1.0" xmlns:junit="https://schemas.junit.org/open-test-reporting" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://schemas.junit.org/open-test-reporting https://junit.org/junit5/schemas/open-test-reporting/junit-1.9.xsd">
<infrastructure><hostName>...</hostName><userName>marc</userName><operatingSystem>Linux</operatingSystem><cpuCores>16</cpuCores><java:javaVersion>23.0.2</java:javaVersion><java:fileEncoding>UTF-8</java:fileEncoding><java:heapSize max="16642998272"></java:heapSize></infrastructure>
<e:started id="1" name="JUnit Jupiter" time="2025-02-12T11:34:39.710211313Z"><metadata><junit:uniqueId>[engine:junit-jupiter]</junit:uniqueId><junit:legacyReportingName>JUnit Jupiter</junit:legacyReportingName><junit:type>CONTAINER</junit:type></metadata></e:started>
<e:started id="2" name="JupiterTests" parentId="1" time="2025-02-12T11:34:39.723661620Z"><metadata><junit:uniqueId>[engine:junit-jupiter]/[class:junit.jupiter.JupiterTests]</junit:uniqueId><junit:legacyReportingName>junit.jupiter.JupiterTests</junit:legacyReportingName><junit:type>CONTAINER</junit:type></metadata><sources><java:classSource className="junit.jupiter.JupiterTests"></java:classSource></sources></e:started>
<e:started id="3" name="generateDynamicTests()" parentId="2" time="2025-02-12T11:34:39.731520789Z"><metadata><junit:uniqueId>[engine:junit-jupiter]/[class:junit.jupiter.JupiterTests]/[test-factory:generateDynamicTests()]</junit:uniqueId><junit:legacyReportingName>generateDynamicTests()</junit:legacyReportingName><junit:type>CONTAINER</junit:type></metadata><sources><java:methodSource className="junit.jupiter.JupiterTests" methodName="generateDynamicTests" methodParameterTypes=""></java:methodSource></sources></e:started>
<e:started id="4" name="Test-0 [Test A]" parentId="3" time="2025-02-12T11:34:39.751487520Z"><metadata><junit:uniqueId>[engine:junit-jupiter]/[class:junit.jupiter.JupiterTests]/[test-factory:generateDynamicTests()]/[dynamic-test:#1]</junit:uniqueId><junit:legacyReportingName>generateDynamicTests()[1]</junit:legacyReportingName><junit:type>TEST</junit:type></metadata><sources><java:methodSource className="junit.jupiter.JupiterTests" methodName="generateDynamicTests" methodParameterTypes=""></java:methodSource></sources></e:started>
<e:finished id="4" time="2025-02-12T11:34:39.757689540Z"><result status="SUCCESSFUL"></result></e:finished>
<e:started id="5" name="Test-1 [Test B]" parentId="3" time="2025-02-12T11:34:39.759501311Z"><metadata><junit:uniqueId>[engine:junit-jupiter]/[class:junit.jupiter.JupiterTests]/[test-factory:generateDynamicTests()]/[dynamic-test:#2]</junit:uniqueId><junit:legacyReportingName>generateDynamicTests()[2]</junit:legacyReportingName><junit:type>TEST</junit:type></metadata><sources><java:methodSource className="junit.jupiter.JupiterTests" methodName="generateDynamicTests" methodParameterTypes=""></java:methodSource></sources></e:started>
<e:finished id="5" time="2025-02-12T11:34:39.760203497Z"><result status="SUCCESSFUL"></result></e:finished>
<e:started id="6" name="Test-2 [Test C]" parentId="3" time="2025-02-12T11:34:39.760651282Z"><metadata><junit:uniqueId>[engine:junit-jupiter]/[class:junit.jupiter.JupiterTests]/[test-factory:generateDynamicTests()]/[dynamic-test:#3]</junit:uniqueId><junit:legacyReportingName>generateDynamicTests()[3]</junit:legacyReportingName><junit:type>TEST</junit:type></metadata><sources><java:methodSource className="junit.jupiter.JupiterTests" methodName="generateDynamicTests" methodParameterTypes=""></java:methodSource></sources></e:started>
<e:finished id="6" time="2025-02-12T11:34:39.761198556Z"><result status="SUCCESSFUL"></result></e:finished>
<e:finished id="3" time="2025-02-12T11:34:39.763590632Z"><result status="SUCCESSFUL"></result></e:finished>
<e:finished id="2" time="2025-02-12T11:34:39.765473357Z"><result status="SUCCESSFUL"></result></e:finished>
<e:finished id="1" time="2025-02-12T11:34:39.766198737Z"><result status="SUCCESSFUL"></result></e:finished>
</e:events> Is |
|
Please share the full output of |
The same error is for this java version.
|
Well, since I cannot reproduce it, I'm unable to find the root cause and fix it. Could you please extract a minimal, reproducible example from your project and share it as a zip file or a GitHub repo? |
Seems like found the cause. |
@gtach2o I've fixed the root cause in |
It works now with no issue. |
junit-platform-console-standalone-1.11.4.jar
Originally posted by @gtach2o in #4312
The text was updated successfully, but these errors were encountered: