Search code examples
unit-testingtfsmstest

Tests not working... MSTest.TestAdapter & MSTest.TestFramework not compatible with TFS 2015 SP3?


Background: We use VS2019 and .NET 4.7.2 our current solutions. We use TFS 2015 SP3 and have numerous (60+) builds running unit tests with MSTest V2, etc. These use MSTest.TestAdapter and TestFramework up to 2.1.2.

So, I'm working with a new MSTest V2 project in a typical solution. I noticed MSTest.TestAdapter and TestFramework nuget packages do not seem to work with TFS 2015 SP3. In the build log, I do see the following error: no test found. make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

I cannot figure out what to do to get the 2.2.3 packages to work with TFS. If I downgrade those two packages to 2.1.2, the tests will run just fine in TFS. Is this just a case of TFS 2015 being too old?

I'd like to stay as current as I can, given the TFS constraint. Is there a way to get the TestAdapter and TestFramework 2.2.3 (or future releases) to work with TFS 2015 SP3?

Thanks in advance!


Solution

  • I managed to figure it out. Here's what I did.

    1. Uninstall the MSTest.TestAdapter & MSTest.TestFramework nuget packages.
    2. Reinstall 2.1.2 of those packages. Check in. Allow CI build to run tests. All good.
    3. Upgraded the packages to 2.2.3 which installed a large number of dependencies. Check in. Allow CI build to run tests. FAILED to run tests. Needed one more package... TFS needed Microsoft.TestPlatform.ObjectModel.
    4. Installed Microsoft.TestPlatform.ObjectModel 16.9.4 via nuget package manager.
    5. Check in. Allow CI build to run tests. TESTS RAN. GOOD TO GO.