I have a weird problem while building VS2010 solution incl. unit tests on a Team Build 2008 server. It builds the solution and also can run the test without an error, but after running the test I get following warning which makes the build breaking:
MSBUILD : warning MSB6003: The specified task executable "MSTest.exe" could not be run. The system cannot find the file specified [C:\data\builds\FSuite\CI_Project[Debug]\BuildType\TFSBuild.proj] The previous error was converted to a warning because the task was called with ContinueOnError=true. Build continuing because "ContinueOnError" on the task "TestToolsTask" is set to "true".
It does not seem to be the problem that MSTest have not been found, I also checked if the TFSBuild.proj file is on this localtion - it is not missing. So what could it be?
Edit: In meantime I figured out, that our old build server loaded and start the test assemblies once.
Task "TestToolsTask" Command:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe /nologo /runconfig:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Sources\Sources\Products\FSuite.Debug.testrunconfig" /searchpathroot:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]开发者_JS百科\Binaries\x86\Debug" /resultsfileroot:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\TestResults" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.AppConfiguration.Console.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.Common.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.Common.UI.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.Dbms.Handler.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Base.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.BusinessObjects.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Client.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Client.UI.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Enums.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Messages.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Reporting.ReportPackage.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Reporting.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.MasterStation.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.MonitoringStation.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Pac.ProductInspection.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Pac.XmlRpcProtocol.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Server.DomainLayer.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Server.Licensing.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Server.NotificationLayer.Tests.Unit.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Tests.Unit.Ext.dll" /testcontainer:"C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Tests.Unit.Joint.dll" /publish:"http://ch06sd01:8080/" /publishbuild:"V1.0_CI_FSuite[Debug]_20100728.4" /teamproject:"FSuite" /platform:"x86" /flavor:"Debug" The "TestToolsTask" task is using "MSTest.exe" from "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe". Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Sources\Sources\Products\FSuite.Debug.testrunconfig... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.AppConfiguration.Console.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.Common.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.Common.UI.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.Dbms.Handler.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Base.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.BusinessObjects.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Client.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Client.UI.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Enums.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Messages.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Reporting.ReportPackage.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Reporting.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.MasterStation.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.MonitoringStation.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Pac.ProductInspection.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Pac.XmlRpcProtocol.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Server.DomainLayer.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Server.Licensing.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Server.NotificationLayer.Tests.Unit.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Tests.Unit.Ext.dll... Loading C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Tests.Unit.Joint.dll... Starting execution...Results...
2387/2387 test(s) Passed Summary ------- Test Run Warning. Passed 2387 ------------ Total 2387 Results file: C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\TestResults\ch06-tfsservice_CH06WL2013302 2010-07-28 11_08_03_x86_Debug.trx
Run Configuration: FSuite Debug Testconfig Run has the following issue(s): Code coverage instrumentation warning while processing file MT.FSuite.Joint.Enums.dll: TESTTOOLSTASK : warning VSP2007: C:\data\builds\FSuite\V1.0_CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Joint.Enums.dll contains no instrumentable code. TESTTOOLSTASK : warning : Test Run deployment issue: The assembly or module 'DevExpress.RichEdit.v10.1.Core' directly or indirectly referenced by the test container 'c:\data\builds\fsuite\v1.0_ci_fsuite[debug]\binaries\x86\debug\mt.fsuite.tests.unit.ext.dll' was not found. Waiting to publish... Publishing results of test run ch06-tfsservice@CH06WL2013302 2010-07-28 11:08:03_x86_Debug to http://ch06sd01:8080/Build/v1.0/PublishTestResultsBuildService2.asmx... ................................Publish completed successfully. Done executing task "TestToolsTask".
But the new build server with VS2010 loads all test assemblies except the MT.FSuite.Tests.Unit.Joint.dll and executes the tests, which run successfully, afterwards MSTest get called again with the mentioned assembly and failes.
Command: MSTest.exe /nologo /runconfig:"C:\data\builds\FSuite\CI_FSuite[Debug]\Sources\Sources\Products\FSuite.Debug.testrunconfig" /searchpathroot:"C:\data\builds\FSuite\CI_FSuite[Debug]\Binaries\x86\Debug" /resultsfileroot:"C:\data\builds\FSuite\CI_FSuite[Debug]\TestResults" /testcontainer:"C:\data\builds\FSuite\CI_FSuite[Debug]\Binaries\x86\Debug\MT.FSuite.Tests.Unit.Joint.dll" /publish:"http://ch06sd01:8080/" /publishbuild:"CI_FSuite[Debug]_20100728.2" /teamproject:"FSuite" /platform:"x86" /flavor:"Debug" The "TestToolsTask" task is using "MSTest.exe" from "MSTest.exe".
I wonder why, because the test container string did not change and furthermore the second time it does not say anymore from where it gets the MSTest.exe...
Thanks for help, Eny
OK, I've found the source of the problem. The TeamBuild targets file (C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets) has a wrong value - replace the following:
<UsingTask TaskName="TestToolsTask"
AssemblyFile="$(MSTestRefPath)\Microsoft.VisualStudio.QualityTools.MSBuildTasks.dll"
Condition="'$(ProjectFileVersion)' == '2'" />
(the last UsingTask at line 82 if you haven't edited the file already) with:
<UsingTask TaskName="Microsoft.TeamFoundation.Build.Tasks.TestToolsTask"
AssemblyFile="C:\Program Files\Microsoft Visual Studio
10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.ProcessComponents.dll"
Condition=" '$(ProjectFileVersion)' == '2' "/>
This fixed it for me, and now my build lights are all green.
精彩评论