[英].trx test file generation in ng run test for sonar cloud code coverage
I am facing issues to get code coverage report via sonar cloud in my angular project.我在我的 angular 项目中遇到了通过声纳云获取代码覆盖率报告的问题。
I have configured karma tool to get the test report.我已经配置了 karma 工具来获取测试报告。 Output file is generating test report in .xml format.
输出文件正在生成 .xml 格式的测试报告。 I configured the test report path in sonar as well:
我也在声纳中配置了测试报告路径:
sonar.cs.vscoveragexml.reportsPaths=$(Agent.BuildDirectory)/TestResults/*.xml
But sonar cloud is searching for .trx extension test report.Below is the error log.但是声纳云正在搜索 .trx 扩展测试报告。以下是错误日志。
06:16:44.724 Looking for TRX files in: D:\a\1\TestResults
06:16:44.724 No test results files found
06:16:45.083 Did not find any binary coverage files in the expected location.
06:16:45.083 Falling back on locating coverage files in the agent temp directory.
06:16:45.083 Searching for coverage files in D:\a\_temp
Requesting to help me to resolve the same.请求帮助我解决同样的问题。
By default, if you not specified other file path, the TRX file is exist under s
file, it's file path is under $(System.DefaultWorkingDirectory), not $(Agent.BuildDirectory).默认情况下,如果没有指定其他文件路径,TRX文件存在于
s
文件下,它的文件路径在$(System.DefaultWorkingDirectory)下,而不是$(Agent.BuildDirectory)下。
According to the error message:根据错误信息:
Looking for TRX files in: D:\\a\\1\\TestResults
在以下位置查找 TRX 文件:D:\\a\\1\\TestResults
D:\\a\\1\\TestResults
, this is the incorrect file path which is the TRX file exist by default. D:\\a\\1\\TestResults
,这是错误的文件路径,默认存在TRX文件。
So, if you did not specified another file path in VSTest, the .TRX
file path should be reading as D:\\a\\1\\s\\TestResults
which is under $(build.SourcesDirectory)
instead of $(Agent.BuildDirectory) .因此,如果您没有在 VSTest 中指定另一个文件路径,则
.TRX
文件路径应读取为D:\\a\\1\\s\\TestResults
,它位于$(build.SourcesDirectory)
而不是 $(Agent.BuildDirectory) 下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.