用于在没有vsmdi的情况下进行测试的TFS签入策略

时间:2022-07-01 22:35:25

In our msbuild script we can run unit tests without using the vsmdi file:

在我们的msbuild脚本中,我们可以在不使用vsmdi文件的情况下运行单元测试:

We would like to enforce tests to be run on check in. The "Testing policy" seems to require a .vsmdi file. Is there a way to do this without one?

我们希望强制执行在签入时运行的测试。“测试策略”似乎需要.vsmdi文件。没有一个有没有办法做到这一点?

1 个解决方案

#1


The out-of-the-box testing policy simply checks for the presence of a TestResults folder that has been created since the last checkin, indicating that MSTest has been run. If it finds one it then scans the test results for a reference to the .vsmdi file that is mentioned.

开箱即用的测试策略只检查是否存在自上次签入以来已创建的TestResults文件夹,表明已运行MSTest。如果找到一个,则扫描测试结果以获取对所提及的.vsmdi文件的引用。

You could write a custom policy that does much the same thing but instead of looking for a .vsmdi file in the test results look for something else as an indicator that tests you want run have actually been run (and that they pass).

您可以编写一个自定义策略,它可以执行相同的操作,但不是在测试结果中查找.vsmdi文件,而是查找其他内容作为指示,您希望运行的测试实际上已经运行(并且它们已通过)。

#1


The out-of-the-box testing policy simply checks for the presence of a TestResults folder that has been created since the last checkin, indicating that MSTest has been run. If it finds one it then scans the test results for a reference to the .vsmdi file that is mentioned.

开箱即用的测试策略只检查是否存在自上次签入以来已创建的TestResults文件夹,表明已运行MSTest。如果找到一个,则扫描测试结果以获取对所提及的.vsmdi文件的引用。

You could write a custom policy that does much the same thing but instead of looking for a .vsmdi file in the test results look for something else as an indicator that tests you want run have actually been run (and that they pass).

您可以编写一个自定义策略,它可以执行相同的操作,但不是在测试结果中查找.vsmdi文件,而是查找其他内容作为指示,您希望运行的测试实际上已经运行(并且它们已通过)。