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
MSTest Runner: Provide a sample for usage in a project that uses WindowsAppSdk #2620
Comments
Hi @abdes, Thanks for the question! This was actually part of some of my experimentations yesterday :D I have found and fixed a bug (see #2617) and I was able to list what's working and not working. I need to sync with WinUI team to understand the way forward. I will post a simple example later today, maybe you could review it and give me some feedback. |
Thanks @Evangelink for the super fast reply. I'm always available if you need to try something. |
Please find enclosed a basic example of supporting MSTest runner with WinUI project MSTestRunnerWinUI.zip. As stated in the csproj, not all modes are working (it seems that there is some issue with unpackage and self-contained). |
Here are my observations so far:
|
Hello @Evangelink and @abdes , I am experiencing the same issue explained here and therefore thought of trying out MSTest Runner property in WinUI3 application, but I not able to get preview version
|
@mit456 here is a Nuget.config file that will let you get the preview versions of MSTest:
Your .csproj seem OK. If you still run into problems, please look carefully at the sample provided by @Evangelink . Note that as of now, the setup works fine within Visual Studio Test Explorer, but I did not find any way (yet), to make it work from the command line, either via the new executable runner or via
Even if we properly set the DispatcherQueue in the App.OnLaunched or in a Test Initializer. |
@abdes Thank you very much for fast reply. Well, if that's the case then I am also able to execute it using Visual Studio Test Explorer but when executing it from command line Please let me know if I can be of any help. Otherwise, I will keep an eye on the issue. |
For the time being, Test Explorer (both for VS and VS Code) will always run tests using VSTest platform and so won't use MSTest runner. We have provided an improvement to this but this is waiting to be shipped into VS.
By default The support for WinUI with MSTest runner is not yet official as this is not something we have tested or worked on. Following @abdes suggestion, I have started to do some POC to see what's working or not. This is still considered as experimental but I do hope to find some time to sync with WinUI team and work on the failing parts so we can provide a proper experience. |
Hello @Evangelink Thank you for clarifying things for me. I did try to enable
But if I remove
My random guess is that I need to keep the |
There is indeed some bug with MSTest 3.2 for the support of WinUI. This is fixed in this PR #2617 that targets main (so v3.4) that I haven't backported to 3.3 that I will release this week because the support is not yet complete. If you follow the steps described above for the nuget.config and use |
✅ Successfully linked to Azure Boards work item(s): |
It's not clear how the new MSTest runner fits in a context where the test project uses WindowsAppSdk or WinUI.
Such projects use a WinExe output type already and use custom setup code for the TestExecutor in the App startup code.
Please refer to: https://devblogs.microsoft.com/ifdef-windows/winui-desktop-unit-tests/ for more context on these types of test projects.
AB#2050328
The text was updated successfully, but these errors were encountered: