问题描述
我想在VSTS的TfsPublisher记录器(云)使用vstest.console.exe。
还有的文章 TFS现场,但我试图找出哪些参数用于我的VSTS建设。这个例子是:
<$p$p><$c$c>/logger:TfsPublisher;Collection=http://localhost:8080/tfs/DefaultCollection;TeamProject=MyProject;BuildName=DailyBuild_20121130.1但我只是得到一个错误说构建不能在项目中,例如被发现。
错误:构建1234不能在团队项目MyProject的发现。
我相信问题是BuildName参数。我的项目和构建定义在名称中没有空格。我曾尝试各种数值,例如:
BuildName =%BUILD_BUILDID%(解析为数字,例如1234)
BuildName =%BUILD_DEFINITIONNAME%(解析构建定义名称OK)
BuildName =%BUILD_BUILDURI%(解析URL,例如vstfs:///构建/编译/ 1234)
该错误消息证实,环境变量似乎是解决好了,但我不能确定我应该在我的情况下,代替DailyBuild_20121130.1。
更新:我vstest.console.exe记录参数目前看起来像
<$p$p><$c$c>/logger:TfsPublisher;Collection=%SYSTEM_TEAMFOUNDATIONCOLLECTIONURI%;TeamProject=%SYSTEM_TEAMPROJECT%;BuildName=%BUILD_BUILDNUMBER%我得到了有效的利用我的事务处理记录器和一个想要的结果发布的测试结果打造步骤:
vstest.console.exe ... /记录器:事务处理
I'm trying to use vstest.console.exe with the TfsPublisher logger in VSTS (cloud).
There's a URL example shown in the article for TFS onsite, but I'm trying to work out what parameters to use for my VSTS build. The example is:
/logger:TfsPublisher;Collection=http://localhost:8080/tfs/DefaultCollection;TeamProject=MyProject;BuildName=DailyBuild_20121130.1
But I just get an error saying the build cannot be found in the project, e.g.
Error: Build "1234" cannot be found under team project "MyProject".
I believe the problem is the BuildName parameter. My project and build definition have no spaces in the names. I have tried various values, e.g.:
BuildName=%BUILD_BUILDID% (resolves to number, e.g. 1234)
BuildName=%BUILD_DEFINITIONNAME% (resolves to build definition name OK)
BuildName=%BUILD_BUILDURI% (resolves to url, e.g. vstfs:///Build/Build/1234)
The error message confirms that the environment variables seem to be resolving OK, but I can't determine what I should substitute for "DailyBuild_20121130.1" in my case.
Updated: My vstest.console.exe logger parameter currently looks like
/logger:TfsPublisher;Collection=%SYSTEM_TEAMFOUNDATIONCOLLECTIONURI%;TeamProject=%SYSTEM_TEAMPROJECT%;BuildName=%BUILD_BUILDNUMBER%
I effectively got the result I wanted using the Trx logger and one of the "Publish Test Results" build steps:
vstest.console.exe ... /logger:Trx
这篇关于通过VSTS命令行测试运行器发布测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!