MSTest 日志文件显示orderedtest 结果的无效计数
我尝试了很多有序测试,但 .trx 文件总是显示错误的计数?
例如,如果我有一个包含 2 个测试的有序测试,则结果在 .trx 文件(结果摘要节点)中如下所示:
<Counters total="3" executed="3" passed="3" error="0" failed="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0"/>
但是只有 2 个测试!如果我有 29 项测试,它会显示总共 30 项,等等...
有什么想法吗?
I have tried many orderedtests and the .trx file always shows the wrong count?
for instance, if i had an orderedtest with 2 tests, the results look like this in the .trx file (results summary node):
<Counters total="3" executed="3" passed="3" error="0" failed="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0"/>
But there are only 2 tests!!! If i have 29 tests, it says 30 total, etc...
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将把钱押在这样一个事实上:有序测试本身也被 MSTEST 算作已运行的测试。这是因为它的结构方式:
因此,它始终将父有序测试容器添加为正在执行的常规测试。这也意味着,如果您从有序测试中运行有序测试(包含内部测试),您的计数将为 4,而实际上只有 2 个测试在功能上相关并经过测试。
就我个人而言,我发现更令人不安的是,如果有序测试中的所有测试并非 100% 成功(警告,不确定),则有序测试总是失败!完全地!无法控制!
但这是一个题外话,令人沮丧:-)
I will place my money on the fact that the ordered test itself is also counted by MSTEST as a test that is run. This is because of the way it is structured:
So it always adds the parent ordered test container as a regular test being performed. This would also mean that if you run an ordered test (with to inner tests) from within an ordered test, your count would be 4 while actually only 2 test are functionally relevant and tested.
Personally what I find more disturbing, is that if not all tests in an ordered test are 100% successful (warnings, inconclusive) the ordered test always fails! Completely! Uncontrollable!
But that was an off topic frustration :-)