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)
[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)
Please sign in to leave a comment.
What build runner do you use?
Could you plase check msbuild.exe process has been started.
Thanks!
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.
I have the same error but a bit different log:
[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)
Thanks,
Dan Lash
Any ideas on this?
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!
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
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
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!
Properties defined in the agent configuration file or determined based on the OS environment
Additional properties defined by JVM and agent runtime
It found mstest 9.0 from
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!
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?
[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
MSTest properties of the build configuration. I am not sure where to pull the commandline info you requested from.
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
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!