1
votes

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 Results

Other 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
}
1
Do your tests run correctly inside VS2010 via the test runner? - mfloryan
@mfloryan: The project/solution is not converted to VS2010. - Bernard Vander Beken
Did you try running the build with increased verbosity? Is there more info in the test results? I'd start by running the test runner manually. - mfloryan
Update: I tested with MStest /testcontainer:my.dll. Result: tests run and pass with MStest from VS 2008 command prompt, tests fail with MStest from VS 2010 command prompt. How can I get the verbose information? Is there an easy way to force TFS 2010 to use the VS 2008 / .NET 3.5 MSTest.exe? - Bernard Vander Beken

1 Answers

3
votes

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!