MSTest integration issue with TeamCity 5.1.x

Hello,

So far we have been using a mix of NUnit and MSTest for DotNet project. We simply specify the DLL to run the test from with no issue. However, we have a project that require to run a script to configure a database prior to running the test.

Manually, we can run the script using the testconfig before the actual test with no problem. However we failed to make the same setup work under TeamCity.

We tried to add the MSTest metadata file (vsmdi) but without success. We also tried to use the config file (testrunconfig) in the section available in TeamCity but still nothing.

The config file for the test is as follow (the script to run is TestSetup.cmd)

<?xml version="1.0" encoding="UTF-8"?>

<TestRunConfiguration name="RxAssystLib.Test" id="6d2ab443-190f-4c00-940e-a02cb049dfb9" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2006">

  <Description>This is a default test run configuration for a local test run.</Description>

  <Scripts setupScript=".\RxAssystLib.Test\Script\TestSetup.cmd" />

  <TestTypeSpecific />

</TestRunConfiguration>

In the attached files, we've included the screen shot for our setup.

MSTest_TeamCity.jpg

Should that setup work as expected?

Thank you in advance.

2 comments
Comment actions Permalink

Hi

Please enable debug logging, and start one more build. In the build log there is a line like

[14:53:34]: [Step 2/2] 2011-03-30 14:53:34,194 [916] DEBUG JetBrains.TeamCity.Utils.Runtime.ProcessRun - Start process: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /runconfig:C:\TeamCity\buildAgent\work\9468c4cb35a6bf3b\Local.testsettings /testcontainer:C:\TeamCity\buildAgent\work\9468c4cb35a6bf3b\StackMstP\bin\Debug\StackMstP.dll /resultsfile:C:\TeamCity\buildAgent\temp\buildTmp\tmp9B28.tmp.teamcity.trx
[14:53:34]: [Step 2/2] 2011-03-30 14:53:34,194 [916] DEBUG JetBrains.TeamCity.Utils.Runtime.ProcessRun - Start process in: C:\TeamCity\buildAgent\work\9468c4cb35a6bf3b


Try to run MSTest.exe with the same paramerers right from work directory, and check whether it works.

Michael

0
Comment actions Permalink

Hello,

I actually manage to make it work on my own using the output log. However, i did found an issue where if i specify the same test result output file, it doesn't get overwritten the next time the build is called but rather the previous result are reloaded.So for now, i have to set the test result file as "File%Build%.trx" so each build create the output.

It seems this is an issue dating back to TeamCity 4.x

Thank you

0

Please sign in to leave a comment.