Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need documentation and basic example of test discovery/execution API, if it exists #40799

Open
JeroMiya opened this issue May 8, 2024 · 1 comment

Comments

@JeroMiya
Copy link

JeroMiya commented May 8, 2024

Type of issue

Missing information

Description

The MSTest runner documentation bills the MSTest runner as a replacement for VSTest, but the primary reason I use VSTest is for custom test discovery and execution for multi-environment integration tests. We wrap a custom internal web UI around VSTest to list, filter, execute tests (in a given internal or external environment) and generate custom reports.

So far, the documentation is unclear whether the test discovery side of the VSTest is supported, or if there is a strongly typed C# wrapper around the test execution side. From what I can see, only the test execution side is supported, and only through the CLI by executing the test output (an exe on windows) directly.

I don't see how to implement test discovery. There is the --list-tests option, but it only prints the test method names. It doesn't list test method test properties (including custom properties, which is important for my use case), and I'm not sure if there's an option to have it list them in json format vs a human readable list printed after some unrelated startup text (implying I'd need to write my own fragile parser).

On the test execution side, I know I can pass arguments directly to the test exe via a Process.Start call, but VSTest provided a C# wrapper around test execution. Does MSTest provide something similar? The documentation doesn't say, and it's difficult to determine looking from the code at a cursory glance. A lot of the test host classes are either internal or their constructors are. Is this something that is planned, but not yet implemented? Are custom test hosts not planned to be supported by design?

Page URL

https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-mstest-runner-intro

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/testing/unit-testing-mstest-runner-intro.md

Document Version Independent Id

c6f1f63a-3871-51de-5385-59e72eff58e7

Article author

@nohwnd

Metadata

  • ID: b75b7156-e2e2-b7d4-ead7-1fef711c3041
  • Service: dotnet-fundamentals
@nohwnd
Copy link
Member

nohwnd commented May 14, 2024

We don't have a clear plan around creating a client similar to TranslationLayer/VSTestConsoleWrapper. For the moment you can still use the current one https://www.nuget.org/packages/Microsoft.TestPlatform.TranslationLayer/17.10.0-release-24177-07, because there is a fallback in the VSTest bridge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants