简体   繁体   English

Azure Devops VS 测试任务中的问题代码覆盖率。 .Coverage 未创建

[英]Problem code coverage in Azure Devops VS test task. .Coverage not created

I'am trying to create a build pipeline in Azure DevOps which contain a "vs test task".我正在尝试在 Azure DevOps 中创建一个包含“vs 测试任务”的构建管道。 Nothing fancy here.这里没有什么花哨的。 I want to get the code coverage to send it to sonaQube.我想获得代码覆盖率以将其发送到 sonaQube。 However, after the pipeline went through the task there is not.Coverage file created.但是,在管道完成任务后,并没有创建.Coverage 文件。

vs测试任务出错

There is some errors that might be the issue but i'm not sure.有一些错误可能是问题,但我不确定。 there is a big "Data collection: Could not find data collector 'Code Coverage'", This might be related to the fact that my UnitTestProject.dll is built for Framework 4.6.2 and Platform AnyCPU(for this issue I tried to forced: otherConsoleOptions:/Framework:NETFramework,Version=v4.6.2').有一个很大的“数据收集:找不到数据收集器'代码覆盖率'”,这可能与我的 UnitTestProject.dll 是为框架 4.6.2 和平台 AnyCPU 构建的事实有关(对于这个问题,我试图强制: otherConsoleOptions:/Framework:NETFramework,Version=v4.6.2')。

My agent is running on Windows server 2012 and Visual Studio Enterprise everything is up to date: VS version我的代理在 Windows 服务器 2012 和 Visual Studio Enterprise 上运行,一切都是最新的: VS 版本

[command]"C:\Program Files (x86)\Microsoft VisualStudio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" @C:\Agent_AzureDevOps_1_work_temp\22f8bb11-e53e-11e9-95d5-5bdab8c29281.txt Microsoft (R) Test Execution Command Line Tool Version 15.9.0 [命令]“C:\Program Files (x86)\Microsoft VisualStudio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe”@C:\Agent_AzureDevOps_1_work_temp\22f8bb11-e53e-11e9-95d5- 5bdab8c29281.txt Microsoft (R) 测试执行命令行工具版本 15.9.0

My.trx file is created, however, my.coverage file is nowhere to be seen. My.trx 文件已创建,但是 my.coverage 文件无处可见。 I made sure Code Coverage was Enabled.我确保已启用代码覆盖率。

My package contain those NuGet NuGet in my package.config我的package 在我的 ZEFE90A8E604A7C840E88D03A6ZD87F6.

I'am blocked and don't know where to look anymore if you guys have an idea.如果你们有想法,我被阻止了,不知道在哪里看。

Thanks for the time.谢谢你的时间。 If you guys want more information don't hesitate to ask.如果你们想了解更多信息,请不要犹豫。

I do not have enough reputation to add a comment, so I hope this post will not be deleted (although it is not a direct answer, I think).我没有足够的声誉来添加评论,所以我希望这个帖子不会被删除(虽然我认为这不是一个直接的答案)。 I wanted to suggest you the following:我想建议你以下几点:

Do you have an own *.runsettings file (where you might have specified a specific entry? If you do not specify a *.runsettings file by yourself, the Azure DevOps vstest@2 Task will use a "default" runsettings file. At least this is what I could observe in the log ( debug=true )您是否有自己的*.runsettings文件(您可能在其中指定了特定条目?如果您不自己指定*.runsettings文件,Azure DevOps vstest@2 任务将使用“默认”运行设置文件。至少这是我可以在日志中观察到的( debug=true

Hope this helps希望这可以帮助

BR Michael BR迈克尔

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM