0

我正在从 vstest.console.exe 创建覆盖数据,并且覆盖文件是 coveragexml 格式。其他项目能够导入覆盖数据,但此文件包含一些特殊字符,并且无法将数据导入 Sonar Dashboard。

<?xml version="1.0" encoding="UTF-8" ?>
<results>
  <modules>
    <module name="se.tsc.gateway.tests.dll" path="se.tsc.gateway.tests.dll" id="8666CE64A1D9D647B882DD709C72AB4901000000" block_coverage="74.31" line_coverage="92.31" blocks_covered="81" blocks_not_covered="28" lines_covered="48" lines_partially_covered="4" lines_not_covered="0">
      <functions>
        <function id="8272" token="0x6000001" name="TestInitialize()" type_name="TSCControllerTest" block_coverage="100.00" line_coverage="100.00" blocks_covered="3" blocks_not_covered="0" lines_covered="4" lines_partially_covered="0" lines_not_covered="0">
          <ranges>
            <range source_id="0" covered="yes" start_line="22" start_column="9" end_line="22" end_column="10" />
            <range source_id="0" covered="yes" start_line="23" start_column="13" end_line="23" end_column="76" />
            <range source_id="0" covered="yes" start_line="24" start_column="13" end_line="24" end_column="38" />
            <range source_id="0" covered="yes" start_line="25" start_column="9" end_line="25" end_column="10" />
          </ranges>
        </function>
        <function id="8312" token="0x6000008" name="MoveNext()" type_name="TSCControllerTest.GetRequestStatusMethod.&lt;RequestGetTSC_ShouldReturnInvalidCompanyId&gt;d__0" block_coverage="70.83" line_coverage="87.50" blocks_covered="17" blocks_not_covered="7" lines_covered="7" lines_partially_covered="1" lines_not_covered="0">
          <ranges>
            <range source_id="0" covered="yes" start_line="32" start_column="13" end_line="32" end_column="14" />
            <range source_id="0" covered="yes" start_line="34" start_column="17" end_line="34" end_column="96" />
            <range source_id="0" covered="yes" start_line="35" start_column="17" end_line="35" end_column="29" />
            <range source_id="0" covered="yes" start_line="36" start_column="17" end_line="36" end_column="36" />
            <range source_id="0" covered="yes" start_line="37" start_column="17" end_line="37" end_column="44" />
            <range source_id="0" covered="partial" start_line="40" start_column="17" end_line="40" end_column="113" />
            <range source_id="0" covered="yes" start_line="43" start_column="17" end_line="43" end_column="71" />
            <range source_id="0" covered="yes" start_line="44" start_column="13" end_line="44" end_column="14" />
          </ranges>
        </function>
        <function id="8748" token="0x600000a" name="MoveNext()" type_name="TSCControllerTest.GetRequestStatusMethod.&lt;RequestGetTSC_ShouldReturnInvalidASRInput&gt;d__8" block_coverage="70.83" line_coverage="87.50" blocks_covered="17" blocks_not_covered="7" lines_covered="7" lines_partially_covered="1" lines_not_covered="0">
          <ranges>
            <range source_id="0" covered="yes" start_line="48" start_column="13" end_line="48" end_column="14" />
            <range source_id="0" covered="yes" start_line="50" start_column="17" end_line="50" end_column="96" />
            <range source_id="0" covered="yes" start_line="51" start_column="17" end_line="51" end_column="30" />
            <range source_id="0" covered="yes" start_line="52" start_column="17" end_line="52" end_column="36" />
            <range source_id="0" covered="yes" start_line="53" start_column="17" end_line="53" end_column="38" />
            <range source_id="0" covered="partial" start_line="56" start_column="17" end_line="56" end_column="113" />
            <range source_id="0" covered="yes" start_line="59" start_column="17" end_line="59" end_column="70" />
            <range source_id="0" covered="yes" start_line="60" start_column="13" end_line="60" end_column="14" />
          </ranges>
        </function>
        <function id="9168" token="0x600000c" name="MoveNext()" type_name="TSCControllerTest.GetRequestStatusMethod.<RequestGetTSC_ShouldReturnInvalidRONumbe>d__10" block_coverage="70.83" line_coverage="87.50" blocks_covered="17" blocks_not_covered="7" lines_covered="7" lines_partially_covered="1" lines_not_covered="0">
          <ranges>
            <range source_id="0" covered="yes" start_line="64" start_column="13" end_line="64" end_column="14" />
            <range source_id="0" covered="yes" start_line="66" start_column="17" end_line="66" end_column="96" />
            <range source_id="0" covered="yes" start_line="67" start_column="17" end_line="67" end_column="30" />
            <range source_id="0" covered="yes" start_line="68" start_column="17" end_line="68" end_column="37" />
            <range source_id="0" covered="yes" start_line="69" start_column="17" end_line="69" end_column="44" />
            <range source_id="0" covered="partial" start_line="72" start_column="17" end_line="72" end_column="113" />
            <range source_id="0" covered="yes" start_line="75" start_column="17" end_line="75" end_column="69" />
            <range source_id="0" covered="yes" start_line="76" start_column="13" end_line="76" end_column="14" />
          </ranges>
        </function>
        <function id="9612" token="0x600000f" name="&lt;RequestGetTSC_ShouldReturnTSCSettings&gt;b__18(CDK.SE.TSC.GatewayProviderInterface.ITSCProvider)" type_name="TSCControllerTest.GetRequestStatusMethod.&lt;&gt;c__DisplayClass19" block_coverage="100.00" line_coverage="100.00" blocks_covered="3" blocks_not_covered="0" lines_covered="1" lines_partially_covered="0" lines_not_covered="0">
          <ranges>
            <range source_id="0" covered="yes" start_line="89" start_column="22" end_line="89" end_column="59" />
          </ranges>
        </function>
        <function id="9656" token="0x6000010" name="MoveNext()" type_name="TSCControllerTest.GetRequestStatusMethod.&lt;RequestGetTSC_ShouldReturnTSCSettings&gt;d__1b" block_coverage="77.42" line_coverage="95.65" blocks_covered="24" blocks_not_covered="7" lines_covered="22" lines_partially_covered="1" lines_not_covered="0">
          <ranges>
            <range source_id="0" covered="yes" start_line="80" start_column="13" end_line="80" end_column="14" />
            <range source_id="0" covered="yes" start_line="82" start_column="17" end_line="82" end_column="96" />
            <range source_id="0" covered="yes" start_line="83" start_column="17" end_line="83" end_column="30" />
            <range source_id="0" covered="yes" start_line="84" start_column="17" end_line="84" end_column="36" />
            <range source_id="0" covered="yes" start_line="85" start_column="17" end_line="85" end_column="44" />
            <range source_id="0" covered="yes" start_line="86" start_column="17" end_line="86" end_column="77" />
            <range source_id="0" covered="yes" start_line="87" start_column="17" end_line="87" end_column="88" />
            <range source_id="0" covered="yes" start_line="88" start_column="17" end_line="91" end_column="41" />
            <range source_id="0" covered="partial" start_line="94" start_column="17" end_line="94" end_column="78" />
            <range source_id="0" covered="yes" start_line="97" start_column="17" end_line="97" end_column="116" />
            <range source_id="0" covered="yes" start_line="98" start_column="13" end_line="98" end_column="14" />
          </ranges>
        </function>
      </functions>
      <source_files>
        <source_file id="0" path="d:\BambooBld\SVE-TSCG2-JOB1\TSC\Gateway\SE.TSC.Gateway.Tests\TSCControllerTest.cs">
        </source_file>
      </source_files>
    </module>
  </modules>
</results>

type_name 看起来很奇怪并且有特殊字符。如果这是 vstest.console.exe 或 c# 声纳插件的问题,请告诉我。

注意:显示单元测试编号,但未显示代码覆盖率。

在此处输入图像描述

4

0 回答 0