如何防止TFS移动vstest.console运行设置文件
我正在测试从TFS2015到TFS2017的升级,在运行单元测试时遇到问题 测试需要一个runsettings文件: 运行设置文件在物理上位于如何防止TFS移动vstest.console运行设置文件,tfs,Tfs,我正在测试从TFS2015到TFS2017的升级,在运行单元测试时遇到问题 测试需要一个runsettings文件: 运行设置文件在物理上位于C:\TFS\1\s,但由于某些原因,TFS2017正在将其复制到C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\tmpA03,如日志中所示: 2017-02-01T21:04:44.9728814Z Working folder: C:\TFS\1\s 2017-02-01T21
C:\TFS\1\s
,但由于某些原因,TFS2017正在将其复制到C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\tmpA03
,如日志中所示:
2017-02-01T21:04:44.9728814Z Working folder: C:\TFS\1\s
2017-02-01T21:04:44.9728814Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\TFS\1\s\SpecFlow2\bin\Debug\SpecFlowTests.dll" "C:\TFS\1\s\UnitTests\bin\Debug\UnitTests.dll" "C:\TFS\1\s\UnitTests-Analytics\bin\Debug\UnitTests-Analytics.dll" /TestCaseFilter:"TestCategory!=MultiThreadedTests&TestCategory!=Purgatory" /Settings:"C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\tmpA03.tmp" /logger:trx
但是,My runsettings包含对testsettings的引用:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<!-- 0 = As many processes as possible, limited by number of cores on machine, 1 = Sequential (1 process), 2-> Given number of processes up to limit by number of cores on machine-->
<ResultsDirectory>.\TestResults</ResultsDirectory>
<MaxCpuCount>3</MaxCpuCount>
<TargetPlatform>x64</TargetPlatform>
</RunConfiguration>
<MSTest>
<SettingsFile>SingleThreaded.testsettings</SettingsFile>
<ForcedLegacyMode>true</ForcedLegacyMode>
</MSTest>
</RunSettings>
测试结果
3.
x64
SingleThreaded.testsettings
真的
因为SingleThreaded.testsettings
保留在C:\TFS\1\s
中,所以测试运行失败,即使我手动复制文件,测试仍然失败,因为一些测试依赖于测试的工作目录
如何防止TFS将我的runsettings文件移动到temp文件夹并从正确的目录执行 在TFS 2017中,我无法在以下设置下再现您的问题: 在日志中,运行设置文件是从
C:\Agent\\u work\10\s\Parallel.runsettings
获取的,因此TFS不会自动移动设置文件:
2017-02-03T06:08:37.8352139Z Working folder: C:\Agent\_work\10\s
2017-02-03T06:08:37.8352139Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\Agent\_work\10\s\ClassLibrary1\bin\Release\Microsoft.TeamFoundation.TestManagement.Client.dll" "C:\Agent\_work\10\s\TestCaseProject\bin\Release\Microsoft.TeamFoundation.Test.WebApi.dll" "C:\Agent\_work\10\s\TestCaseProject\bin\Release\Microsoft.TeamFoundation.TestManagement.Client.dll" "C:\Agent\_work\10\s\TestCaseProject\bin\Release\Microsoft.TeamFoundation.TestManagement.WebApi.dll" "C:\Agent\_work\10\s\UnitTestProject1\bin\Release\Microsoft.TeamFoundation.TestManagement.Client.dll" "C:\Agent\_work\10\s\UnitTestProject1\bin\Release\UnitTestProject1.dll" /Settings:"C:\Agent\_work\10\s\Parallel.runsettings" /logger:trx
请检查是否已在生成定义的“存储库”选项卡中映射运行设置文件。并尝试清理生成代理上的缓存文件:C:\Users\username\AppData\Local\Microsoft\Team Foundation\7.0\cache
如果问题仍然存在,请尝试部署新的生成代理以查看其工作方式。不幸的是,即使在部署新代理后问题仍然存在。对不起,我仍然无法重现您的问题。你清理缓存文件夹了吗?您是否有另一台机器来部署生成代理?我发现在我的其他生成定义中没有出现问题,因此我认为重新创建生成定义可能会起作用,但我无法在周五再次测试它,因为在我手动取消一个失败的生成后,我开始得到一个错误“无法将签入验证排入生成定义队列。详细信息:已添加具有相同键的项。“错误。我发现“并行运行”复选框是新路径的罪魁祸首,它在我的菜单上被勾选。使用“覆盖测试运行参数”时也会发生这种情况。临时.runsettings文件保存在_temp中