Issues using MSTests

I cannot for the life of me get teamcity to run the mstests.  The error I am getting stuck on is the following from the build log.  I know that the file it is trying to load is not there because it is not creating it.  Can someone help me determine how to change the settings so it will build the file it is looking for.  Thank you

[10:25:23]: MSTest
[10:25:23]: [MSTest] Caught exception while running service process importData
[10:25:23]: [MSTest] java.io.FileNotFoundException: C:\TeamCity\buildAgent\temp\buildTmp\tmp3D6B.tmp.teamcity.trx (The system cannot find the file specified)
java.io.FileNotFoundException: C:\TeamCity\buildAgent\temp\buildTmp\tmp3D6B.tmp.teamcity.trx (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at jetbrains.buildServer.mstest.results.XmlParserBase.parse(XmlParserBase.java:19)
at jetbrains.buildServer.mstest.results.MSTestTRXParser.parse(MSTestTRXParser.java:95)
at jetbrains.buildServer.mstest.results.MSTestDataProcessor.processData(MSTestDataProcessor.java:29)
at jetbrains.buildServer.agent.impl.inspections.DataImportServiceMessage$1.run(DataImportServiceMessage.java:92)
at jetbrains.buildServer.agent.impl.serviceProcess.impl.ThreadedServiceProcessFactory$1.run(ThreadedServiceProcessFactory.java:30)
at java.lang.Thread.run(Thread.java:595)




15 comments
Comment actions Permalink

What build runner do you use?
Could you plase check msbuild.exe process has been started.

Thanks!

0
Comment actions Permalink

Thank you for taking the time to help me with this situation.

I have verified that MSBuild.exe executes and is running while the build is being built.

I am using sln2008 as my build runner.

0
Comment actions Permalink

I have the same error but a bit different log:

[15:59:59]: MSTest
[15:59:59]: [MSTest] Publishing artifacts
[15:59:59]: [Publishing artifacts] Caught exception while running service process importData
[15:59:59]: [MSTest] java.io.FileNotFoundException: D:\ContinuousIntegration\Tools\Agent2\temp\buildTmp\tmp32FA.tmp.teamcity.trx (The system cannot find the file specified)
java.io.FileNotFoundException: D:\ContinuousIntegration\Tools\Agent2\temp\buildTmp\tmp32FA.tmp.teamcity.trx (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at jetbrains.buildServer.mstest.results.XmlParserBase.parse(XmlParserBase.java:19)
at jetbrains.buildServer.mstest.results.MSTestTRXParser.parse(MSTestTRXParser.java:95)
at jetbrains.buildServer.mstest.results.MSTestDataProcessor.processData(MSTestDataProcessor.java:29)
at jetbrains.buildServer.agent.impl.inspections.DataImportServiceMessage$1.run(DataImportServiceMessage.java:92)
at jetbrains.buildServer.agent.impl.serviceProcess.impl.ThreadedServiceProcessFactory$1.run(ThreadedServiceProcessFactory.java:30)
at java.lang.Thread.run(Thread.java:595)


I am also using sln2008 build runner and trying to set up MSTest for the first time. The build doesn't say that it failed, but it doesn't say that any tests pass either.


Thanks,

Dan Lash
0
Comment actions Permalink

Any ideas on this?

0
Comment actions Permalink

Do you have the file tmp32FA.tmp.teamcity.trx on you build agent's temp folders?
Could you please try to catch mstest.exe commandline? You may consider useing Process Explorer for that.
Thanks!

0
Comment actions Permalink

I do not have the file it's looking for. I only have these:

msbuild-EnterpriseConfiguration.sln.teamcity.msbuild.tcargs.633540096000000000..tcargs  (5KB)
msbuild-EnterpriseConfiguration.sln.teamcity.patch.tcprojx.633540096000000000..tcprojx  (2KB)
tmp956E.tmp  (0KB)


Also, what do you mean 'catch mstest.exe command line' ?


Thanks,

Dan Lash

0
Comment actions Permalink

Are you thinking it is not able to find mstest.exe? I searched the server and found two executables in:

D:\Program Files\Microsoft Visual Studio 9.0\Common7
D:\Program Files\Microsoft Visual Studio 8\Common7

Do I need to configure where mstest is located at? When I try to run mstest.exe from command line in any random directory, it cannot find it -- so it must not be in PATH. Does it need to be?


Dan Lash

0
Comment actions Permalink

It should not be in PATH.
Could you please attach build agent system properties taken from the web page.

I mean to get the commandline of mstest process that is started under TeamCity build agent to run those mstests.

Thanks!

0
Comment actions Permalink
Here are the System Properties of the build agent I am running.  I have been following this thread to see if I can fix my problem the same way.   

Properties defined in the agent configuration file or determined based on the OS environment

DotNetFramework2.0
DotNetFramework2.0_Path   C:\Windows\Microsoft.NET\Framework\v2.0.50727
DotNetFramework2.0_x86
DotNetFramework2.0_x86_Path   C:\Windows\Microsoft.NET\Framework\v2.0.50727
DotNetFramework3.0
DotNetFramework3.0_Path   C:\Windows\Microsoft.NET\Framework\v3.0
DotNetFramework3.0_x86
DotNetFramework3.0_x86_Path   C:\Windows\Microsoft.NET\Framework\v3.0
DotNetFramework3.5
DotNetFramework3.5_Path   C:\Windows\Microsoft.NET\Framework\v3.5
DotNetFramework3.5_x86
DotNetFramework3.5_x86_Path   C:\Windows\Microsoft.NET\Framework\v3.5
MSTest.9.0   C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe
VS2008
VS2008_Path   c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
WindowsSDK6.0
WindowsSDK6.0A
WindowsSDK6.0A_Path   C:\Program Files\Microsoft SDKs\Windows\v6.0A
WindowsSDK6.0_Path   C:\Program Files\Microsoft SDKs\Windows\v6.0A
teamcity.agent.cpuBenchmark   210
teamcity.dotnet.coveragelauncher   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\TeamCityRunners\JetBrains.dotTrace.TeamCity.CoverageRunner.exe
teamcity.dotnet.nunitaddin   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit
teamcity.dotnet.nunitlauncher   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe
teamcity.dotnet.nunitlauncher.msbuild.task   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll
teamcity.dotnet.nunitlauncher1.1   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe
teamcity.dotnet.nunitlauncher2.0   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe
teamcity.dotnet.nunitlauncher2.0.vsts   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe
teamcity.dotnet.platform   C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe

Additional properties defined by JVM and agent runtime

agent.home.dir C:\TeamCity\buildAgent
agent.name Appserver2
agent.work.dir C:\TeamCity\buildAgent\work
file.encoding Cp1252
file.separator \
os.arch x86
os.name Windows Vista
os.version 6.0
path.separator ;
teamcity.build.tempDir C:\TeamCity\buildAgent\temp\buildTmp
user.country US
user.home C:\
user.language en
user.name SYSTEM
user.timezone America/Denver
user.variant
0
Comment actions Permalink

It found mstest 9.0 from

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe


Could you please attach the commandline that was used to start mstest.exe under build agent.
Please attach screenshot of mstest settings from build configuration settings as well.



Thanks!
0
Comment actions Permalink

Sorry, duplicate post.

Here is my mstest.exe.config:
<?xml version ="1.0"?>
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <probing privatePath="PrivateAssemblies;PublicAssemblies"/>
        </assemblyBinding>
    </runtime>
</configuration>


I tried capturing the process but it fails too quickly. Is there another way to get the command line used? Log maybe?

0
Comment actions Permalink

[2009-02-24 11:14:57,345] out - MSTest_TeamCity_generated_385e88a6104e476da3e6bd065e791002:
[2009-02-24 11:14:57,345] out -   Microsoft (R) Test Execution Command Line Tool Version 9.0.21022.8
[2009-02-24 11:14:57,345] out -   Copyright (c) Microsoft Corporation. All rights reserved.
[2009-02-24 11:14:57,345] out -      
[2009-02-24 11:14:57,345] out -   File "EnterpriseConfiguration.Services.UnitTests" not found .
[2009-02-24 11:14:57,347] out -   For switch syntax, type "MSTest /help"
[2009-02-24 11:14:57,587] out -   The command ""D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" /testcontainer:EnterpriseConfiguration.Services.UnitTests /resultsfile:D:\ContinuousIntegration\Tools\Agent3\temp\buildTmp\tmpD8F4.tmp.teamcity.trx" exited with code 1.
[2009-02-24 11:14:57,605] out - Done Building Project "D:\ContinuousIntegration\Tools\Agent3\work\244f68c0098b038c\CentRic\Enterprise Configuration\2.1.0\EnterpriseConfiguration.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_385e88a6104e476da3e6bd065e791002;MSTest_TeamCity_generated_385e88a6104e476da3e6bd065e791002 target(s)).

So dispite the funky error message, the log has a bit more detail about what is happening. It looks like it cannot find the 'testcontainer' ... I will research this a bit and find out what it wants.


Dan Lash

0
Comment actions Permalink

MSTest properties of the build configuration.   I am not sure where to pull the commandline info you requested from.

MSTest Settings
Run MSTests
Path to MSTest.exe: Enter the path to MSTest.exe. Use %system.MSTest.9.0% to refer to build agent auto-detected MStest.exe. Note to delete any TeamCity reference to MSTest if disabling MSTest runner.
MSTest assemblies: List assembly files:
Edit assemlies list Edit assemlies list Edit assemlies list:
*\VSUnitTests\bin\Debug:VSUnitTests.dll
Hide
Enter newline-separated list of assemblies. Each assembly will be passed in the separate /testcontainer:file commandline argument
MSTest run configuration file: Enter MSTest configuration file. /runconfig:file commandline argument is used
MSTest metadata: Enter a value for /testmetadata: argument
Testlist from metadata to run
Edit testlist Edit testlist Edit testlist:
Hide
Every line will be translated into /testlist:line argument.
Test:
Edit tests Edit tests Edit tests:
Hide
Add /unique commandline argument
Results file: Enter a value for /resultsfile:file commandline argument.
Additional commandline parameters: Enter an additional commandline parameters for MSTest.exe


0
Comment actions Permalink

Ok I'm not sure what the * and : mean in your configuration but I have just gotten my configuration to work (finally). Here is what I used:


Build Runner:
sln2008

Solution File Path:
CentRic/Enterprise Configuration/2.1.0/EnterpriseConfiguration.sln

MSTest Assemblies:
%teamcity.build.checkoutDir%\CentRic\Enterprise Configuration\2.1.0\EnterpriseConfiguration.Services.UnitTests\bin\Debug\EnterpriseConfiguration.Services.UnitTests.dll


I think what is happening is that mstest is not starting up in the checkout directory, it's in some random location. So you have to specify the FULL path to your unit test container (read dll). To achieve that I used the System Property for the checkoud directory described here:

http://www.jetbrains.net/confluence/display/TCD3/System+Properties+of+a+Build+Configuration

So you'll note the solution file path and the mstest assemblies both use our internal directory structure: CentRic\Enterprise Configuration\2.1.0 :as well as any further path to the files in question.

Hope that helps you, Darren


Dan Lash

0
Comment actions Permalink

I've just added an issue to our tracker to ensure MSTest is able to locate files with checkout directory relative paths.
Could you please watch/vote/have a look to the issue at
http://www.jetbrains.net/tracker/issue/TW-7376

Thanks!

0

Please sign in to leave a comment.