使用AsConfigured,仍然能够在TFS中获取UnitTest结果 [英] Using AsConfigured and still be able to get UnitTest results in TFS

查看:106
本文介绍了使用AsConfigured,仍然能够在TFS中获取UnitTest结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当我使用tfs构建控制器在输出"位置"AsConfigred"构建项目时遇到一个问题,它将无法检测到我的单元测试.让我提供一些有关我的设置的信息.

So I am running into an issue when I go to build my projects using tfs build controller using the Output location "AsConfigred" it will not detect my unit tests. Let me give a little info on my setup.

TFS 2013 Update 2,默认过程模板

TFS 2013 Update 2, Default Process Template

以下是一些屏幕快照,可以帮助填补我无法键入的内容.我将构建复制到网络上的文件共享中,以便我们可以使用其他实用程序使用输出.我不想使用"PerProject"或"SingleFolder",因为它们会弄乱我们配置的文件结构(这两个都将运行测试).因此,我将文件复制到文件夹名称"SingleOutputFolder",这是DropLocation的子级.对于每个测试,我都希望能够从drop文件夹运行或从bin文件夹运行(我不在乎哪个).但是,它似乎无法检测/运行任何测试.任何帮助将不胜感激.如果您需要其他任何信息,请告诉我.

Here is a few screenshots that can hopefully help fill in what I can't in typing. I am copying my build out to a file share on our network so that we can use other utilities use the output. I don't want to use "PerProject" or "SingleFolder" because they mess up the file structure we have configured (These both will run the tests). So i have the files copy to folder names "SingleOutputFolder" which is a child of the DropLocation. I would like to be able to run from the drop folder or run from the bin folder for each of my tests (I don't care which). However it doesn't seem to detect/run ANY of the tests. Any help would be greatly appreciated. Please let me know if you need any additional information.

我尝试使用*** test * .dll,Install \ SingleFolderOutput **.test.dll和$(TF_BUILD_DROPLOCATION)\ Install \ SingleFolderOutput * test * .dll

I have tried using ***test*.dll, Install\SingleFolderOutput**.test.dll, and $(TF_BUILD_DROPLOCATION)\Install\SingleFolderOutput*test*.dll

但是我不确定哪些变量可用,并且不知道其执行范围在哪里.

But I am not sure what variables are available and understand where the scope of its execution is.

推荐答案

我最终要做的是添加一个后构建事件,以将所有test.dll复制到

What I ended up doing was adding a post build event to copy all of the test.dll into the staging location folder in the specific build that is basically equivalent to where it would go on a SingleFolder build and do that on each test project.

if "$(TeamBuildOutDir)" == "" (
echo "Building Interactively not in TFS"
) else (
echo "Building in TFS"
xcopy "$(TargetDir)*.*" "$(TeamBuildBinaries)\" /Y /E /S
)

build def中的MSBUILD参数告诉它基本上将其放入TFS查找它们的文件夹中.

MSBUILD parameter in the build def that told it to basically drop in the folder that TFS looks for them.

/p:TeamBuildBinaries="$(TF_BUILD_BINARIESDIRECTORY)"

保留默认的测试程序集文件规范:

Kept the default Test assembly file specification:

**\*test*.dll

查看此链接以获取有关我使用的变量及其存在的相对路径的信息.

View this link for the information on the variable that I used and what relative path it exists at.

这篇关于使用AsConfigured,仍然能够在TFS中获取UnitTest结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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