-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable dotnet test in dotnet/runtime #945
Comments
xunit for devices supports UWP with .NET Native FYI. The Xamarin Essentials folks have done work to help automate and track that and I welcome improvements there too. |
@onovotny From the readme it seems that you are injecting the MainPage.xaml into the test unit project. Would it be possible to change the test unit project to a UWP console app instead of injecting the MainPage.xaml so that we don't invoke a GUI? Currently for UWP we use https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.XUnitRunnerUap which consists of a runner and and a launcher. The runner is a UWP console app and xunit runner which just runs the tests that are discover able and the launcher bundles the runner and the UWP test project together as we can't do Assembly.Load in UWP. The injecting strategy is interesting and something I haven't thought of before. If xunit for devices could inject everything so that a UWP console app would be the result that could eliminate our custom runner for UWP which would be awesome. |
@ViktorHofer a UWP console app is in the plan for xUnit 3.0 and will be supported by "regular xUnit" @bradwilson. xUnit 3 plans to run all tests this way, essentially creating the exe that runs the tests. Whether it's .NET Framework, .NET Core, or UWP, is just a matter of what you target. |
A better question is if vstest supports UWP console apps? Right now, their test adapter for UWP is pretty specific and they provide their own GUI entry point. If you use the latest xUnit for Devices templates (via the VSIX in the marketplace), it supports both VSTest and running standalone via F5. Either way though has GUI popup. However, I believe VSTest takes care of registering/deploying/running the test app so you don't need that C++ launcher code. I'm not completely sure though... |
Thanks for the info. Does that mean with xunit 3 we will have two ways of testing UWP or will the UWP support be removed from xunit for devices? Regarding the VSTest support I will open an issue. It would be great if we could get rid of all the bundling, registering, deploying and the whole custom runner. That said I don't expect that to happen anytime soon... |
You have two ways today and you'll have three ways in xUnit 3:
|
Understood. Thanks! |
As you said option 3 is still tbd but can you guess if it'll be possible to just have a "normal" csproj sdk proejct and not a UWP template? So that it will inject all the UWP stuff into it, i.e. manifest, legacy csproj, etc. |
Details are TBD but almost surely we will be telling people to make console apps for their target platform, not class libraries. |
uapaot isn't a concern here anymore. uap will continue to use our custom runner. |
The |
I got dotnet vstest working locally with corefx. A few hurdles I hit:
|
@BruceForstall @sandreenko @hoyosjs do you know if switching to dotnet vstest would cause issues on the coreclr side? |
As long as it supports response files for test exclusion, and doesn't have the bugs we fixed in our fork (dotnet/arcade#1613), it seems like it would be ok. Of course, it would be worth testing that hypothesis. |
So what we do is:
Off the top of my head, we'd need to confirm the following:
|
Unfortunately not :( @mayankbansal018 @singhsarab wouldn't it make sense to allow multiple testcasefilter options and concatenate them with the & operator?
Right, xunit only allows filtering on:
with exact or contains matches. I'm not sure why this limitation applies to xunit. @onovotny should know. |
@ViktorHofer The code that actually does the matching is part of VSTest itself: |
@mayankbansal018 @singhsarab do you know why VSTest doesn't offer the same rich filters for xunit as for MSTest? |
cc @echesakovMSFT @RussKeldorph |
@mayankbansal018 @singhsarab to explain a bit more, we need to map our current rsp file https://github.com/dotnet/coreclr/blob/master/tests/CoreFX/CoreFX.issues.rsp to a format that dotnet test understands. |
The remaining work to make
I expect this to take about 1 dev weeks. This also fixes the issue that VS Test Explorer discovers ActiveIssue/Conditional (ie OS specific) tests which should not be run. cc @ericstj @danmosemsft @stephentoub @safern |
Investigate how much work it is to switch away from the deprecated xunit.console runner to dotnet vstest. This is just about the runner, the test infra backend will still be xunit.
UAP will continue using Microsoft.DotNet.XUnitRunnerUap.
UAPAOT is problematic. We currently use xunit.console for it which doesn't work (https://github.com/dotnet/corefx/issues/30423). It may be our best option to add a ifdef configuration in dotnet/arcade#1627 which works fine with uapaot.
The text was updated successfully, but these errors were encountered: