简体   繁体   English

Azure 使用 SonarCloud 的 DevOps 未找到测试

[英]Azure DevOps with SonarCloud not finding tests

I'm using SonarCloud with AzureDevops.我将 SonarCloud 与 AzureDevops 一起使用。

The sequence in my YAML file is:我的 YAML 文件中的序列是:

  1. Restore NuGet恢复 NuGet
  2. Sonar Prepare声纳准备
  3. Build solution构建解决方案
  4. Run tests运行测试
  5. Sonar Analyze声纳分析
  6. Sonar Publish声纳发布

I don't specify any output locations (at least, not knowingly).我没有指定任何 output 位置(至少,在不知情的情况下)。

When the tests run, I get the following output:当测试运行时,我得到以下 output:

Test results files: d:\a_temp\TestResults\VssAdmin.....trx测试结果文件:d:\a_temp\TestResults\VssAdmin.....trx

But when the Sonar Analysis step executes, I get the following output:但是当声纳分析步骤执行时,我得到以下 output:

Looking for TRX files in: d:\a\1\TestResults在以下位置寻找 TRX 文件:d:\a\1\TestResults

So....the paths don't match.所以....路径不匹配。

Do I:我是否:

  • tell Azure to write the tests to a different folder?告诉 Azure 将测试写入不同的文件夹?
  • or, do I tell Sonar where to find the test results?或者,我是否告诉 Sonar 在哪里可以找到测试结果?

I'm guessing the second option might be easier - in a different solution I've not yet set up, there are many test projects....我猜第二个选项可能更容易 - 在我尚未设置的不同解决方案中,有很多测试项目......

Thanks谢谢

That's because in VSTest task, test results are stored in $(Agent.TempDirectory)/TestResults by default.这是因为在 VSTest 任务中,测试结果默认存储在$(Agent.TempDirectory)/TestResults中。 You could change it to $(Common.TestResultsDirectory) .您可以将其更改为$(Common.TestResultsDirectory)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 SonarCloud 和 Azure DevOps 分析 Javascript/Typescript 项目 - Analyse Javascript/Typescript project with SonarCloud and Azure DevOps 如何使用 Azure DevOps 为 Javascript 项目配置声纳云分析 - How to configure sonarcloud analysis for Javascript project using Azure DevOps 将 .NET Core 项目的测试范围从 Azure DevOps 发布到 SonarCloud - Publish Test Coverage of .NET Core Project from Azure DevOps to SonarCloud Azure devops 构建后,SonarCloud 中未显示代码覆盖率 - Code coverage is not showing up in SonarCloud after Azure devops build 未从 Azure Devops .NET 核心构建获得 SonarCloud 中的代码覆盖率 - Not getting code coverage in SonarCloud from an Azure Devops .NET core build Azure 中的 Sonarcloud 门 Devops 拉取请求卡在等待状态 - Sonarcloud gate in Azure Devops pull request stuck in waiting status SonarCloud 分析任务在 Azure DevOps PR 管道中失败 - SonarCloud analysis task fails in Azure DevOps PR pipeline 当我们将 azure devops 与自托管代理一起使用时,SonarCloud 出现问题 - SonarCloud issue when we use azure devops with self hosted agent SonarCloud - 无法为 Azure DevOps 管道设置覆盖分析 - SonarCloud - Cannot setup coverage analysis for Azure DevOps pipeline 将参数传递给 Azure Devops 中的测试 - Pass arguments to tests in Azure Devops
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM