我有一个与TFS BuildServer + TestControler +几个TestAgents集成的环境。
在此之前,我使用了一个*.testsettings文件并在角色下面定义了远程服务器。
我将BuildServer更新为VS2013,并引入了用于测试执行的SpecRun。
由于我有一个用于TFS的自定义*.srprofile文件,所以我必须使用一个.runsettings文件而不是.testsettings文件。
我找不到一个标签,可以在.runsettings文件中定义“远程控制器名称”。
有办法在*.runsettings文件中包含“远程控制器名称”吗??
我对构建配置非常陌生。任何有洞察力的人都很感激。
详细信息:
我找到了这文章,并在.runsettings文件中定义了.testsettings文件路径。以下是根据文章修改的文件。但这不管用。可能是SpecRun适配器不支持标签。
我使用的TestSettings文件.
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name=".........." id="........." xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>Remote settings for running the tests on.....</Description>
<Deployment>
....
</Deployment>
<RemoteController name=".....local:6901" />
<Execution location="Remote">
<TestTypeSpecific>
<UnitTestRunConfig testTypeId=".....">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
</TestTypeSpecific>
<AgentRule name=".....">
</AgentRule>
</Execution>
<Properties />
</TestSettings>我现在使用的示例*.runsettings文件.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<!-- Path relative to solution directory -->
<ResultsDirectory>......</ResultsDirectory>
</RunConfiguration>
<SpecRun>
<Profile>TFS.srprofile</Profile>
<ReportFile>TestResults.html</ReportFile>
<GenerateSpecRunTrait>true</GenerateSpecRunTrait>
<GenerateFeatureTrait>false</GenerateFeatureTrait>
<SettingsFile>.....\Remote.AutoTest_2013.testsettings</SettingsFile>
<ForcedLegacyMode>true</ForcedLegacyMode>
</SpecRun>
</RunSettings>发布于 2016-04-13 21:28:47
好的,我认为您所犯的错误是使用runsettings文件。您可以在测试设置文件中指定它。我们的看起来是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="RemoteTest" id="9cfa5873-0238-4d56-a1ec-079192fa72c8" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>Settings set up to run remotely through test controller</Description>
<RemoteController name="**YOURCONTROLLERMACHINE**" />
<Execution location="Remote" hostProcessPlatform="MSIL">
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
</TestTypeSpecific>
<AgentRule name="AllAgentsDefaultRole">
</AgentRule>
</Execution>
<Properties />
</TestSettings>然后从命令行调用它,传入测试设置路径:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\blahblah\TestsAssembly.dll" /Logger:trx /settings:C:\DummyTests\Remote.testsettings /Platform:x64其中TestsAssembly.dll包含您想要运行的测试,而Remote.testsettings就像上面所示。生成的.trx文件出现在测试结果中.
您根本不需要运行设置文件。
https://stackoverflow.com/questions/32107898
复制相似问题