隐藏和排除“覆盖代码”选项卡上的某些参数 (Azure DevOps)

问题描述 投票:0回答:1

是否可以在“覆盖代码”选项卡(Azure DevOps)中隐藏“风险热点”,并从“覆盖代码”的测试结果中排除“Converge.Libraries.NuGetUtilities”和“nameWebApi”(作为示例)标签?是否可以从参数后的参数中的步骤单元测试

--logger:"console;verbosity=normal" --configuration $(buildConfiguration) --collect:"XPlat Code Coverage

我尝试在 VS code 中使用代码,但对我来说它也不起作用。

<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
    <DataCollectionRunSettings>
        <DataCollectors>
            <DataCollector friendlyName="XPlat code coverage">
                <Configuration>
                    <ModulePaths>
                        <Exclude>
                            <ModulePath>.*NuGet.*</ModulePath>
                            <ModulePath>.*nameWebApi.*</ModulePath>                         
                        </Exclude>
                    </ModulePaths>
                </Configuration>
            </DataCollector>
        </DataCollectors>
    </DataCollectionRunSettings>
</RunSettings>
azure-pipelines code-coverage
1个回答
0
投票

我可以向您确认您正在使用

ReportGenerator
扩展在您的管道中转换覆盖率报告吗?如果是这样,您可以使用
customSettings
参数来禁用风险热点。

settings:disableRiskHotspots=false

更多设置请参考文档: https://github.com/danielpalme/ReportGenerator/wiki/Settings

是否可以在参数 xxxx 之后的参数中进行步骤单元测试?

是的,可以。

示例:

 - task: DotNetCoreCLI@2
    displayName: Test .NET
    inputs:
      command: test
      projects: '**\*Test*.csproj'
      publishTestResults: false
      arguments: '--logger:"console;verbosity=normal" --configuration $(buildConfiguration) --collect:"XPlat Code Coverage'

有关

dotnet test
命令的更多信息,您可以参考文档: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test#examples

旁边是您的解决方案中的“Converge.Libraries.NuGetUtilities”和“nameWebApi”(作为示例)项目?

© www.soinside.com 2019 - 2024. All rights reserved.