SonarQube cannot parse TEST-report.xml which contains any failures

前端 未结 1 1074
感情败类
感情败类 2021-01-27 10:11

How to send the XML report to SonarQube? I mean, while the TEST-report.xml file contains any failures, the import operation fails. I got an error:

Ru         


        
相关标签:
1条回答
  • 2021-01-27 10:44

    Your XML report is invalid (doesn't meet the Surefire XML format requirements).

    testsuite required parameters:

    • name - Full class name of the test for non-aggregated testsuite documents. Class name without the package for aggregated testsuites documents
    • tests - The total number of tests in the suite
    • failures - The total number of tests in the suite that failed. A failure is a test which the code has explicitly failed by using the mechanisms for that purpose. e.g., via an assertEquals
    • errors - The total number of tests in the suite that errored. An errored test is one that had an unanticipated problem. e.g., an unchecked throwable; or a problem with the implementation of the test
    • skipped - The total number of ignored or skipped tests in the suite

    The exception starts with DecimalFormat.parse

    java.lang.NullPointerException
        at java.text.DecimalFormat.parse(DecimalFormat.java:2030)
        at java.text.NumberFormat.parse(NumberFormat.java:383)
    

    which means that the XML report parser couldn't parse a number. You have two missing parameters: errors and skipped. I don't know how you generate these reports (which JUnit version etc.), but probably the used tool is outdated or miss-configured.

    0 讨论(0)
提交回复
热议问题