vstest Console输出冗长开关被MSBUILD忽略
我们正在尝试在Azure DevOps管道中降低测试运行的控制台冗长。 由于测试和复杂性的数量,我们将vstest.console.exe包裹在msbuild目标中。
我们配置了vstest.console.exe使用 /logger:console; verbosity =最小。当通过命令提示符手动运行vstest命令时,该命令正常工作,它仅输出跳过的测试和最终结果摘要。
当通过MSBUILD目标执行时,即使我们确认了最简单的目标,控制台的输出也是完整的vstest控制台输出,就好像其在正常的杂句中一样。 我们还将msbuild的详细性设置为最小,但这对vstest输出没有影响。
的目标
<Target Name="RunTestWorker" Outputs="$(VSTestConsoleExitCode)">
<Exec Command=""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\..\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "ProjectA.SpecflowTest.dll" /Platform:x64 /logger:console;verbosity=q /logger:trx;LogFileName=TestTrxFile.trx"
ContinueOnError="True"
WorkingDirectory="$(TestResultsDirectory)..">
</Exec>
</Target>
这是我们可以通过此MSBUILD调用执行
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe" "TestBuild.targets" /verbosity:m /t:RunTestWorker
:我们尝试了其他 msbuild exec 诸如ConsoletomSbuild和Echooff之类的选项,但这并没有太大变化。
这是一个已知问题吗?
We are trying to reduce the console verbosity of our test runs in our Azure DevOps pipelines.
Due to the number of tests and complexity, we wrapped the VSTest.Console.exe run in MSBuild targets.
We configured our vstest.console.exe runs with the /logger:console;verbosity=minimal. When running the vstest command manually through command prompt this works fine, it only outputs the skipped tests and the end result summary, as intended.
When executed through MSBuild targets, even with the simplest target we confirmed, the output to the console is the full VSTest console output as if its in normal verbosity.
We are also setting the MSBuild verbosity to minimal, but this has no effect on the VSTest output.
Here is the target which we can reproduce it with
<Target Name="RunTestWorker" Outputs="$(VSTestConsoleExitCode)">
<Exec Command=""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\..\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "ProjectA.SpecflowTest.dll" /Platform:x64 /logger:console;verbosity=q /logger:trx;LogFileName=TestTrxFile.trx"
ContinueOnError="True"
WorkingDirectory="$(TestResultsDirectory)..">
</Exec>
</Target>
Executed with this MSBuild call:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe" "TestBuild.targets" /verbosity:m /t:RunTestWorker
We tried additional MSBuild Exec options like ConsoleToMSBuild and EchoOff, but this didn't really change much.
Is this a known issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
this Microsoft文档的示例>
/logger之后:
在引号中:我从没有TRX记录器的命令行尝试了一下,并且与正常情况相比,它确实减少了日志记录。
因此,在您的情况下:
This example from Microsoft's docs wraps the arguments after
/logger:
in quotes:I tried this from the command line without the trx logger and it did reduce logging compared to normal.
So in your case: