1. <legend id='7fop4'><style id='7fop4'><dir id='7fop4'><q id='7fop4'></q></dir></style></legend>
        <bdo id='7fop4'></bdo><ul id='7fop4'></ul>
      <i id='7fop4'><tr id='7fop4'><dt id='7fop4'><q id='7fop4'><span id='7fop4'><b id='7fop4'><form id='7fop4'><ins id='7fop4'></ins><ul id='7fop4'></ul><sub id='7fop4'></sub></form><legend id='7fop4'></legend><bdo id='7fop4'><pre id='7fop4'><center id='7fop4'></center></pre></bdo></b><th id='7fop4'></th></span></q></dt></tr></i><div id='7fop4'><tfoot id='7fop4'></tfoot><dl id='7fop4'><fieldset id='7fop4'></fieldset></dl></div>
    2. <small id='7fop4'></small><noframes id='7fop4'>

      <tfoot id='7fop4'></tfoot>

        SonarQube 无法解析包含任何故障的 TEST-report.xml

        SonarQube cannot parse TEST-report.xml which contains any failures(SonarQube 无法解析包含任何故障的 TEST-report.xml)
          <bdo id='UIKMK'></bdo><ul id='UIKMK'></ul>
            <tbody id='UIKMK'></tbody>
          <i id='UIKMK'><tr id='UIKMK'><dt id='UIKMK'><q id='UIKMK'><span id='UIKMK'><b id='UIKMK'><form id='UIKMK'><ins id='UIKMK'></ins><ul id='UIKMK'></ul><sub id='UIKMK'></sub></form><legend id='UIKMK'></legend><bdo id='UIKMK'><pre id='UIKMK'><center id='UIKMK'></center></pre></bdo></b><th id='UIKMK'></th></span></q></dt></tr></i><div id='UIKMK'><tfoot id='UIKMK'></tfoot><dl id='UIKMK'><fieldset id='UIKMK'></fieldset></dl></div>
          <legend id='UIKMK'><style id='UIKMK'><dir id='UIKMK'><q id='UIKMK'></q></dir></style></legend>

                <tfoot id='UIKMK'></tfoot>

                <small id='UIKMK'></small><noframes id='UIKMK'>

                • 本文介绍了SonarQube 无法解析包含任何故障的 TEST-report.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何将 XML 报告发送到 SonarQube?我的意思是,虽然 TEST-report.xml 文件包含任何失败,但导入操作会失败.我收到一个错误:

                  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:

                  Running SonarQube using SonarQube Runner.17:18:18.452 ERROR: Error during SonarScanner execution
                  java.lang.NullPointerException
                      at java.text.DecimalFormat.parse(DecimalFormat.java:2030)
                      at java.text.NumberFormat.parse(NumberFormat.java:383)
                      ...
                  

                  TEST-report.xml 文件 (JUnit) 包含如下内容:

                  The TEST-report.xml file (JUnit) contains something like:

                  <?xml version='1.0' encoding='UTF-8'?>
                  <testsuites name='X UITests.xctest' tests='12' failures='3'>
                    <testsuite name='X.MoreViewTests' tests='1' failures='1'>
                      <testcase classname='X.MoreViewTests' name='testSucceed_allAction'>
                        <failure message='XCTAssertTrue failed'>X UITests/Cases/Bottom Navigation/MoreViewTests.swift:212</failure>
                      </testcase>
                    </testsuite>
                    <testsuite name='X.OrderViewTests' tests='1' failures='0'>
                      <testcase classname='X.OrderViewTests' name='testSucceed_allAction' time='68.570'/>
                    </testsuite>
                  </testsuites>
                  

                  但是当我删除失败行时,变成:

                  But when I removed the failure lines, becomes:

                  <?xml version='1.0' encoding='UTF-8'?>
                  <testsuites name='X UITests.xctest' tests='12' failures='3'>
                    <testsuite name='X.OrderViewTests' tests='1' failures='0'>
                      <testcase classname='X.OrderViewTests' name='testSucceed_allAction' time='68.570'/>
                    </testsuite>
                  </testsuites>
                  

                  它有效.任何的想法?谢谢.

                  It works. Any idea? Thanks.

                  推荐答案

                  您的 XML 报告无效(不符合 Surefire XML 格式要求).

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

                  testsuite所需参数:

                  • name - 非聚合测试套件文档的测试的完整类名.没有用于聚合测试套件文档的包的类名
                  • tests - 套件中的测试总数
                  • failures - 套件中失败的测试总数.失败是代码通过使用用于该目的的机制明确失败的测试.例如,通过 assertEquals
                  • errors - 套件中出错的测试总数.一个错误的测试是一个没有预料到的问题.例如,未经检查的可投掷;或者测试实施有问题
                  • skipped - 套件中忽略或跳过的测试总数
                  • 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

                  异常以DecimalFormat.parse

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

                  这意味着 XML 报告解析器无法解析数字.您缺少两个参数:errorsskipped.我不知道您如何生成这些报告(哪个 JUnit 版本等),但可能使用的工具已过时或配置错误.

                  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.

                  这篇关于SonarQube 无法解析包含任何故障的 TEST-report.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Using Tint color on UIImageView(在 UIImageView 上使用 Tint 颜色)
                  UIButton with both image and text possible?(可以同时具有图像和文本的 UIButton 吗?)
                  Get button pressed id on Swift via sender(通过发件人在 Swift 上获取按钮按下的 id)
                  How to detect one button in tableview cell(如何检测表格视图单元格中的一个按钮)
                  Round Top Corners of a UIButton in Swift(Swift 中 UIButton 的圆顶角)
                  Adding a closure as target to a UIButton(将闭包作为目标添加到 UIButton)

                      <tbody id='SZVDD'></tbody>
                  1. <small id='SZVDD'></small><noframes id='SZVDD'>

                        <legend id='SZVDD'><style id='SZVDD'><dir id='SZVDD'><q id='SZVDD'></q></dir></style></legend>
                        • <i id='SZVDD'><tr id='SZVDD'><dt id='SZVDD'><q id='SZVDD'><span id='SZVDD'><b id='SZVDD'><form id='SZVDD'><ins id='SZVDD'></ins><ul id='SZVDD'></ul><sub id='SZVDD'></sub></form><legend id='SZVDD'></legend><bdo id='SZVDD'><pre id='SZVDD'><center id='SZVDD'></center></pre></bdo></b><th id='SZVDD'></th></span></q></dt></tr></i><div id='SZVDD'><tfoot id='SZVDD'></tfoot><dl id='SZVDD'><fieldset id='SZVDD'></fieldset></dl></div>
                          • <bdo id='SZVDD'></bdo><ul id='SZVDD'></ul>

                            <tfoot id='SZVDD'></tfoot>