-
-
Notifications
You must be signed in to change notification settings - Fork 290
Setting TestingPlatformDotnetTestSupport makes tests non discoverable #2069
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
Comments
cc @farlee2121 |
I tested this, and found some significant problems. First, Microsoft.Testing.Platform doesn't respect This means that using versions of YoloDev.Expecto.TestSdk which depend on Microsoft.Testing.Platform can't define their own main method (and thus can't be run as a normal expecto project). This is true even if Second, Microsoft.Testing.Platform doesn't respect dotnet test flags like --logger and --list-tests. I confirmed that the --logger and --list-tests support is also missing from XUnit, not just YoloDev/Expecto. In short, Microsoft.Testing.Platform won't work with Ionide short of rewriting test and result discovery or Microsoft.Testing.Platform better respecting |
Thanks for looking into this @farlee2121! |
Hi @OnurGumus, @farlee2121, and @TheAngryByrd Let me clarify few points.
There are three points to make here:
|
I've started digging into this. I see how to pass arguments to to Microsoft.Testing.Platform. I also can install the TrxReport extension package and get a report. I'm not seeing a clear way that I can uniformly collect test results without requiring the user to install a package or modify their program. It looks like
The Alternatively, I also haven't found a way to simply register an extension with the test runner without modifying the tested project. @Youssef1313 Am I missing something? Is there an intended way for test explorers to collect test results? |
@farlee2121 It's curious IMO if a test explorer is currently relying on TRX (even for VSTest). For the case of MTP specifically, I think test explorers are expected to launch the executable in server mode and communicate with it via JsonRpc. cc @drognanar If you really need TRX, users are forced to install the TrxReport package in their projects. |
@Youssef1313 The Ionide test explorer was built over dotnet test and trx files. I previously looked into Microsoft.TestPlatform.TranslationLayer, which seems to be the VSTest approach to integration, but got pulled away before I understood it well enough to migrate. It sounds like this JsonRPC approach might be similar. Could you provide links to documentation on the server mode and JsonRpc approach you mentioned? |
I got samples of both VSTest and MTP running over their JSON protocols In short, VSTest still seems like the way to go. VSTest can run both VSTest-based projects and any projects with dual MTP/VSTest support, which seems like everything but TUnit. I tested Expecto, xUnit, NUnit, and MSTest. MTP didn't seem like it could run VSTest-based projects. A switch to VSTest would get us
|
Well, it's both TUnit, and can be xunit when xunit.runner.visualstudio isn't there. The fact that MSTest and NUnit supports both is just for historical reasons. I can speak of MSTest, I'm looking forward to separate the support of MTP and VSTest. If a project supports MTP, it's expected for Test Explorer to use MTP to run. Note that it's just not an implementation detail for which do you use to run tests, it can have real behavior differences.
The two platforms are completely different. None of them supports or can run the other. The fact that MSTest, NUnit, and in some cases xUnit, can run with both is just a choice that framework authors did. But it's your product, you can choose what you want to support and what not to support. |
For what it's worth, I think that would currently give much worse results for Expecto tests (go to location currently works quite well in Ionide, but is quite limited in Visual Studio with the YoloDev adaptor - e.g. YoloDev/YoloDev.Expecto.TestSdk#107 / haf/expecto#487) - I don't know how much effort it would take to get Expectos build in location reporting to work in all these cases |
Describe the bug
There is a new post from microsoft dev blogs
They introduced
TestingPlatformDotnetTestSupport
switch in the project file. Once you set that true, tests aren't discoverable by ionide.To be fair I am not entirely sure what this new switch brings to table.
Steps to reproduce
Create any test project then true
Ionide will complain no tests are discoverable.
Expected behaviour
Ionide should discover the tests
Machine info
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: