teamcity说找不到MSTests的Test xxx [英] teamcity says Test xxx cannot be found for MSTests

查看:115
本文介绍了teamcity说找不到MSTests的Test xxx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一生中,我一直在为Teamcity运行我在单元测试项目中拥有的MSTest进行数周的尝试,这是我正在构建的解决方案的一部分,但是我失败了.

For the life of my I'm trying for weeks for Teamcity to run the MSTests I have in my a unit test project which is part of the solution I'm building but I've failed.

在下面,我列出了我尝试过的各种设置及其结果.

Below I list the various combinations of settings I've tried and their outcomes.

我所能得到的最好的是,我可以使Teamcity对我的测试有所了解,但找不到它们.我已经已尝试 解决方案,但是所有这些都有两个结果.

The best I've got is I can go as far as getting Teamcity to know something about my tests but it can't find them. I have tried several solutions but all of which have two outcomes.

这里是MSTests设置屏幕,以供参考:

Here is the MSTests settings screen for reference:

如果我指定.vsmdi文件的相对路径,则会得到:

If I specify a relative path to the .vsmdi file then I get :

[Step 7/7] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[18:00:13][Step 7/7] in directory: C:\TeamCity\buildAgent\work\5caf6e77ce7b0d2a
[18:00:14][Step 7/7] Microsoft (R) Test Execution Command Line Tool Version 12.0.21005.1
[18:00:14][Step 7/7] Copyright (c) Microsoft Corporation. All rights reserved.
[18:00:14][Step 7/7]     
[18:00:14][Step 7/7] Loading C:\TeamCity\buildAgent\work\5caf6e77ce7b0d2a\XXXX.Engine\XXXX.Engine.vsmdi...
[18:00:16][Step 7/7] Starting execution...
[18:00:16][Step 7/7] Test Check_blah_blah cannot be found.
[18:00:16][Step 7/7] Test blah_blah2 cannot be found.
[18:00:16][Step 7/7] No tests to execute.
[18:00:16][Step 7/7] Process exited with code 0

等因此,它知道,但是有不能运行的测试! :(

etc. So it knows what tests there are, but can't run them! :(

来自其他Web站点的其他解决方案,例如(1)对单元测试项目执行MSBuild步骤,(2)指定.testsettings文件的路径(3)仅指定程序集列表(4)为mstest.exe的路径,而不是teamcity env变量. (5)创建测试列表并指定它...等等,所有这些都会导致以下结果:

Other solutions from the interwebs like (1) Doing an MSBuild step for the unit tests project, (2) Specifying the path to the .testsettings file (3) Specifying only the assemblies list (4) Putting my own value for the path to mstest.exe instead of the teamcity env variable. (5) Creating a test list and specifying it ... etc They all result in this outcome:

[Step 4/4] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[17:54:50][Step 4/4] in directory: C:\TeamCity\buildAgent\work\ccf38e24ca82b24
[17:54:58][Step 4/4] No assemblies, run configuration and test metadata were found (THIS LINE VARIES BASED ON MY SETTINGS BUT the rest is the same)
[17:55:01][Step 4/4] Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
[17:55:01][Step 4/4] Copyright (c) Microsoft Corporation. All rights reserved.
[17:55:01][Step 4/4]     
[17:55:01][Step 4/4] Please specify tests to run, or specify the /publish switch to publish results. 
[17:55:01][Step 4/4] For switch syntax, type "MSTest /help"
[17:55:01][Step 4/4] Process exited with code 1
[17:55:01][Step 4/4] Step RunTests (MSTest) failed

这东西应该如何配置?我有什么公然的失踪吗?也许是愚蠢的事情?

How is this thing supposed to be configured? Is there something blatant I'm missing? Or perhaps something silly?

请帮助!

推荐答案

我认为您的问题可能是包含测试的dll的路径.您已经在根目录下指定了dll,这意味着可以在checkout目录中找到该dll.如果要在TC上构建dll,则不太可能.我们有这样的测试设置:

I think your problem is probably the path to the dlls containing the tests. you have the dll specified at the root, which means its expected to be found in the checkout directory. If you are building the dll's on TC then this is unlikely. We have the test set up like this:

所以我们告诉TC在当前配置目录的所有子目录中查找任何测试dll.我们不使用.vsmdi文件列出测试,所以我不确定是否可以使用,但这是我首先要尝试的方法

so we are telling TC to look in all subdirectories of the current config directory for any test dlls. We don't use .vsmdi files to list the tests so I'm not sure if this will work, but that's what I'd try first

这篇关于teamcity说找不到MSTests的Test xxx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆