Skip to content
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

Failed generating JUnit XML report #4

Closed
2014211497 opened this issue Aug 3, 2021 · 1 comment
Closed

Failed generating JUnit XML report #4

2014211497 opened this issue Aug 3, 2021 · 1 comment

Comments

@2014211497
Copy link

2014211497 commented Aug 3, 2021

Hello, I'm using sdrss/reportNG(2.6.2) and jacoco(0.8.5) at the same time, but something wrong occurred when generating report files, the output logs:

2021-08-03 12:36:24.249  INFO 3642 --- [           main] org.uncommons.reportng.HTMLReporter      : ****************************************

2021-08-03 12:36:24.249  INFO 3642 --- [           main] org.uncommons.reportng.HTMLReporter      : Generate reportNG report

2021-08-03 12:36:24.249  INFO 3642 --- [           main] org.uncommons.reportng.HTMLReporter      : Path : /Users/yclin/codes/java/szaud-platform-backend/target/surefire-reports/html

2021-08-03 12:36:24.401  INFO 3642 --- [           main] org.uncommons.reportng.HTMLReporter      : ****************************************
[TestNG] Reporter [JUnitXMLReporter passed=0 failed=0 skipped=0] failed
org.uncommons.reportng.ReportNGException: Failed generating JUnit XML report.
        at org.uncommons.reportng.JUnitXMLReporter.generateReport(JUnitXMLReporter.java:70)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: java.io.FileNotFoundException: /Users/yclin/codes/java/szaud-platform-backend/target/surefire-reports/xml/net.engyne.szaudplatformbackend.controller.AuthControllerTest_results.xml (No such file or directory)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at java.io.FileWriter.<init>(FileWriter.java:90)
        at org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:85)
        at org.uncommons.reportng.JUnitXMLReporter.generateReport(JUnitXMLReporter.java:68)
        ... 9 more
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.146 s - in TestSuite

My pom.xml:

        <dependency>
            <groupId>com.github.sdrss</groupId>
            <artifactId>reportng</artifactId>
            <version>2.6.2</version>
        </dependency>

        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.5</version>
        </dependency>

My testng.xml:

<suite name="All Test Suite">
    <test verbose="2" preserve-order="true" name="AuthTests">
        <classes>
            <class name="net.engyne.szaudplatformbackend.controller.AuthControllerTest"/>
        </classes>
    </test>
    <listeners>
        <listener class-name="org.uncommons.reportng.HTMLReporter"/>
        <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
    </listeners>
</suite>

Any helpful suggestions would be appreciated, thank you.

@sdrss
Copy link
Owner

sdrss commented Aug 3, 2021 via email

@sdrss sdrss closed this as completed Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants