vstest icon indicating copy to clipboard operation
vstest copied to clipboard

Microsoft.Testing.Platform vs Microsoft.TestPlatform.TestHost package

Open nithinbandaru1 opened this issue 7 months ago • 1 comments

Description

When I create a test project that can be MSTest or NUnit or xUnit, Microsoft.TestPlatform.TestHost package dependency is added as part of Microsoft.NET.Test.Sdk package.

But according to this documentation (https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-vs-vstest) it sounds like Microsoft.Testing.Platform would be added as dependency as quoted form page below.

Execute VSTest tests VSTest ships with Visual Studio, the .NET SDK, and as a standalone tool in the Microsoft.TestPlatform NuGet package. VSTest uses a runner executable to run tests, called vstest.console.exe, which can be used directly or through dotnet test.

Execute Microsoft.Testing.Platform tests

Microsoft.Testing.Platform is embedded directly into your test project and doesn't ship any extra executables. When you run your project executable, your tests run. For more information on running Microsoft.Testing.Platform tests, see Microsoft.Testing.Platform overview: Run and debug tests.

  1. I was also not able to find any DLL being compiled called Microsoft.Testing.Platform or having as sub package under Microsoft.TestPlatform.TestHost or Microsoft.NET.Test.Sdk, When I search nuget I see Microsoft.Testing.Platform package active so not really sure what's happening here. It would be great if some details are provided?

  2. Microsoft.NET.Test.Sdk - Isn't this fit more at csproj root xml element. Looks bit out of place to me.

  3. It looks like Microsoft.Testing.Platform is lightweight portable build compared to Microsoft.TestPlatform, So, what does this exactly means, what is missing compared to Microsoft.TestPlatform? Some windows only components?

  4. Is it Microsoft.Testing.Platform that will do the finding of available adaptors and have methods to call the adaptors to get test list/discover tests, run tests by calling adaptor runner part of code? If that is the case what is its replacement in Microsoft.NET.Test.Sdk?

  5. Is it Microsoft.Testing.Platform that can be used as a nuget dependency for building custom explorers/run initiators like for example instead of console UI like vstest.console.exe or dotnet test, I want to build a Windows UI application. I that case can I use this dependency to interact with adaptors and discover, run tests?

Steps to reproduce

Creating empty project should be sufficient.

Expected behavior

Probably only Microsoft.Testing.Platform should be added as dependency? Not really sure.

Actual behavior

Microsoft.NET.Test.Sdk is added as dependency with Microsoft.Coverage and Microsoft.TestPlatform.TestHost as sub packages.

Diagnostic logs

Not relevant

Environment

Not relevant

nithinbandaru1 avatar Jul 13 '24 19:07 nithinbandaru1