MSTest 日志文件显示orderedtest 结果的无效计数

发布于 2024-12-04 13:32:54 字数 426 浏览 0 评论 0原文

我尝试了很多有序测试,但 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙厌世 2024-12-11 13:32:54

我将把钱押在这样一个事实上:有序测试本身也被 MSTEST 算作已运行的测试。这是因为它的结构方式:

  1. 运行有序测试(测试号 1),开始按顺序处理内部测试,递归地重新使用标准机制来运行任何测试。
  2. 在有序测试中运行第一个测试(测试编号 2)
  3. 在有序测试中运行第二个测试(测试编号 3)

因此,它始终将父有序测试容器添加为正在执行的常规测试。这也意味着,如果您从有序测试中运行有序测试(包含内部测试),您的计数将为 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:

  1. Run Ordered test (test number 1), starts processing the inner tests in sequence recursively re-uses the standard mechanism for running any test.
  2. Run first test in ordered test (test number 2)
  3. Run second test in ordered test (test number 3)

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 :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文