Steps:
- Run the build including unit tests.
Expected result:
- the unit tests are executed and succeed.
Actual result:
- the unit tests are built by the build, but this is the result:
1 test run(s) completed – 0% average
pass rate (0% total pass rate) 0/4
test(s) passed, 0 failed, 4
inconclusive, View Test ResultsOther Errors and Warnings 1 error(s),
0 warning(s) TF270015: ‘MSTest.exe’
returned an unexpected exit code.
Expected ‘0’; actual ‘1’.
All the tests are enumerated (four), but the result for each test is “Not Executed”.
Context:
- Team Foundation Server 2010 release candidate
- A build definition that runs projects using the Visual Studio 2008 project format and .NET 3.5 SP1. The unit tests run on a development machine, within Visual Studio.
- The unit tests project references
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
Typical test class
[TestClass]
public class DemoTest
{
[TestMethod]
public void DemoTestName()
{
}
// etc
}
TFS Build 2010 will only run VS2010 unit test packages as the need to be written in .NET 4.0.
If you can upgrade your projects to VS2010 then this will solve your problem, otherwise you can edit the build workflow for your project to use the 2008 version of MSBuild if you are still using the 2008 client.
The easyest option is just to use VS2010!