xunit / devices.xunit

xUnit.net Runners for Devices
Other
73 stars 35 forks source link

UWP test runners do not work on Visual Studio 2022 #171

Open idg10 opened 1 year ago

idg10 commented 1 year ago

If you follow the xUnit instructions for creating a brand new UWP project from scratch and adding a test the resulting tests will not run. The Visual Studio Explorer shows them, but if you try to run all tests, they won't run.

You can see an example of this in a real project:

  1. clone the https://github.com/dotnet/reactive repo (at commit 85f1eb7 at the time of writing this)
  2. open the System.Reactive.sln solution in Rx.NET/Source in Visual Studio 2022.
  3. Build the solution
  4. Open Test Explorer, and note that the UWP tests are visible
  5. Run all tests, and note that while the non-UWP tests all eventually get green ticks, the UWP tests end up with a blue triangle indicating that they did not run

These tests all run in Visual Studio 2019. Visual Studio 2022 has changed something—either in the way it expects test adapters to work, or in the way it hosts UWP applications.

Note that MSTest continues to work on UWP applications in Visual Studio 2022. So it is certainly possible to make a test adapter that works for UWP on Visual Studio 2022.

idg10 commented 1 year ago

Since the only changes to this repo in the last 4 years have been dependency updates (almost entirely driven by dependabot) or tweaks to the .NET Foundation logo and some xUnit hyperlinks in the docs, I came to the conclusion that the xUnit project has no interest in maintaining support for UWP.

Since the Rx project is committed to continuing to support UWP, this means either we can't use xUnit, or we need to try to drag xUnit's UWP support forward by 4 years to get it working again.

We've moved Rx back to MSTest because it was by far the easier option. I believe Rx originally used MSTest—it never did anything with xUnit that you couldn't do equally well with any other test framework, so this was relatively painless. (Conversely, tackling anything UWP-related is generally a total nightmare because there's no official support for UWP in the modern .NET SDK project system. So getting this working again for xUnit would have been a non-trivial undertaking.)

Since Rx no longer depends on MSTest, I no longer care about this issue. I'm leaving it open on the off chance that this didn't in fact reduce the sum total of people who do care to 0.

bradwilson commented 1 year ago

@idg10 You are correct. @clairernovotny owned this project but has since stepped aside. Since UWP has been deprecated in favor of WinUI, I recently (maybe a week or two ago) let her know that I'd be retiring this project and archiving the repository.