MSTest not showing test results when all tests fail

I'm having some problems running the tests associated with one of our builds using the MSTest settings of the sln2008 runner.

The build runs and successfully launches MSTest, all the tests fail and MSTest exits with a non-zero result, but TeamCity reports the build as successful with no test results.

When TeamCity parses the results file it lists each test with the message: "Failed to read testDuration" and concludes with:
[MSTest] There were no tests  reported. Wrong or broken .trx file?

A snippet of the log file are below (full log and trx files attached).

I'm not sure if this is a bug or a problem with my configuration. Any tips would be appreciated.

[14:44:43]:     [Project...] Starting execution...
[14:44:45]:     [Project...] Results               Top Level Tests
[14:44:45]:     [Project...] -------               ---------------
[14:44:45]:     [Project...] Failed                eSpares.Data.NHibernate.Tests.NHRepositoryTest.Delete_Deletes_Record
[14:44:45]:     [Project...] Failed                eSpares.Data.NHibernate.Tests.NHRepositoryTest.Nested_UnitOfWork_With_Different_Transaction_Compatibility_Works
[14:44:46]:     [Project...] 0/35 test(s) Passed, 35 Failed
[14:44:46]:     [Project...] Summary
[14:44:46]:     [Project...] -------
[14:44:46]:     [Project...] Test Run Failed.
[14:44:46]:     [Project...]   Failed  35
[14:44:46]:     [Project...]   ----------
[14:44:46]:     [Project...]   Total   35
[14:44:46]:     [Project...] Results file:  C:\TeamCity.BuildAgent\temp\buildTmp\tmpF8BC.tmp.teamcity.trx
[14:44:46]:     [Project...] ##teamcity[importData id='mstest' file='C:\TeamCity.BuildAgent\temp\buildTmp\tmpF8BC.tmp.teamcity.trx']
[14:44:46]: Importing data from 'C:\TeamCity.BuildAgent\temp\buildTmp\tmpF8BC.tmp.teamcity.trx' with 'mstest' processor
[14:44:46]: MSTest
[14:44:46]:     [MSTest] Found 35 test definitions.
[14:44:46]:     [MSTest] Test 'eSpares.Data.NHibernate.Tests.NHRepositoryTest.Delete_Deletes_Record': Failed to read testDuration
[14:44:46]:     [MSTest] Test 'eSpares.Data.NHibernate.Tests.NHRepositoryTest.Nested_UnitOfWork_With_Different_Transaction_Compatibility_Works': Failed to read testDuration
[14:44:46]:     [MSTest] There were no tests reported. Wrong or broken .trx file?
[14:44:46]: Process exit code: 0
[14:44:46]: Waiting for 1 service processes to complete
[14:44:46]: Build finished

1 comment
Comment actions Permalink


I've created an issue on your tracker. Please watch/vote for it at


Please sign in to leave a comment.