views:

304

answers:

2

Hello folk,

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]\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

A: 

I have the same problem : MSTest executes all tests fine, publishes the results to TFS, and then... fails.

Using "TestToolsTask" task from assembly "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.QualityTools.MSBuildTasks.dll".
Task "TestToolsTask"
  Command:
  C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /nologo /runconfig:"D:\Source\CommonPlatform\Common Platform Development CI Build\Sources\Src\LocalTestRunWithCoverage.testsettings" /searchpathroot:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug" /resultsfileroot:"D:\Source\CommonPlatform\Common Platform Development CI Build\TestResults" /testcontainer:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Core.Tests.dll" /testcontainer:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.SimpleContent.Tests.dll" /testcontainer:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Web-Framework.Tests.dll" /testcontainer:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Web.Mvc.Tests.dll" /testcontainer:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Web.Tests.dll" /publish:"http://mtfssyd01:8080/" /publishbuild:"vstfs:///Build/Build/3199" /teamproject:"CommonPlatform" /platform:"Any CPU" /flavor:"Debug"  
  The "TestToolsTask" task is using "MSTest.exe" from "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe".
  Loading D:\Source\CommonPlatform\Common Platform Development CI Build\Sources\Src\LocalTestRunWithCoverage.testsettings...
  Loading D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Core.Tests.dll...
  Loading D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.SimpleContent.Tests.dll...
  Loading D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Web-Framework.Tests.dll...
  Loading D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Web.Mvc.Tests.dll...
  Loading D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Web.Tests.dll...
  Starting execution...

***SNIP A LOAD OF PASSING TESTS***

Test Run Completed.
        Passed  459
        -----------
        Total   459
      Results file:  D:\Source\CommonPlatform\Common Platform Development CI Build\TestResults\svcTFSService_W2411193 2010-08-11 17_48_23_Any CPU_Debug.trx
      Test Settings: Local
      Waiting to publish...
      Publishing results of test run svcTFSService@W2411193 2010-08-11 17:48:23_Any CPU_Debug to http://mtfssyd01:8080/...
      ................................Publish completed successfully.
      Command:
      MSTest.exe /nologo /runconfig:"D:\Source\CommonPlatform\Common Platform Development CI Build\Sources\Src\LocalTestRunWithCoverage.testsettings" /searchpathroot:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug" /resultsfileroot:"D:\Source\CommonPlatform\Common Platform Development CI Build\TestResults" /testcontainer:"D:\Source\CommonPlatform\Common Platform Development CI Build\Binaries\Debug\\FairfaxDigital.Data.Tests.dll" /publish:"http://mtfssyd01:8080/" /publishbuild:"vstfs:///Build/Build/3199" /teamproject:"CommonPlatform" /platform:"Any CPU" /flavor:"Debug"  
      The "TestToolsTask" task is using "MSTest.exe" from "MSTest.exe".
    MSBUILD : warning MSB6003: The specified task executable "MSTest.exe" could not be run. The system cannot find the file specified [D:\Source\CommonPlatform\Common Platform Development CI Build\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".
    Done executing task "TestToolsTask" -- FAILED.

The only thing of interest is that the TestToolsTask comes from the VS2008 path (see the first line of the log snippet), while everything else comes from the VS2010 path. Has anyone else seen this problem, and come up with a solution to it? It's infuriating not being able to have successful tests when they all pass!

UPDATE: this is building a VS2010/.NET 4 solution on Team Build 2008.

David Keaveny
A: 

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.

David Keaveny
We have a second build server with a different failure, this was the answer to solve it ^^ But the first build server still has this weird symptom.
Enyra