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

How did I get myself into a place where Microsoft Testing Platform mode is always enabled with dotnet test? #10605

Closed
bradwilson opened this issue Dec 5, 2024 · 7 comments

Comments

@bradwilson
Copy link

bradwilson commented Dec 5, 2024

I'm trying to reproduce a problem with xUnit.net v3 for someone who is using dotnet test, but since installing .NET SDK 8.0.404 (dotnet test --version reporting 17.11.9.46202) it appears that there's no way to disable its recognition and usage of Microsoft.Testing.Platform-compatible test projects, so I'm unable to run tests the same way as users do (that is, through xunit.runner.visualstudio and the TPv2 APIs).

Another way to say this is: <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> is no longer required, and in fact, trying to set the value to false does not turn off MTP support.

Is there any way for me to get the old behavior back, short of creating a VM and installing an older SDK in it?


This is actually about more than just me reproducing this one bug, though. Users will see dotnet test --help and virtually everything on that screen will be wrong because those command line options do not apply when running a Microsoft.Testing.Platform project. How is the user to know this will be the case? How can they get an accurate set of command line options for dotnet test now?


Edit: this turns out to be a local problem that I don't understand but I wouldn't mind help understanding anyways.

@bradwilson
Copy link
Author

If it's useful information, we're currently linked against the 1.4.3 versions of the Microsoft Testing Platform libraries.

@bradwilson
Copy link
Author

Okay, I'm even more confused now.

I tried installing 8.0.403 alongside 8.0.404 on Windows and I still see broken behavior even when sticking to 8.0.403:

Image

However, on 8.0.403 on Ubuntu 24.04 (without 8.0.404) everything is working as expected:

Image

It's not at all clear to me what's going on here.

@bradwilson
Copy link
Author

Upgrading the Ubuntu box from 8.0.403 to 8.0.404 does not break dotnet test as I'd expected it to, so now I feel like my Windows machine is in a weird state with MTP always forced on. Is that possible?

Image

@bradwilson
Copy link
Author

Apparently there is something amiss in my stock test project that I use for reproducing issues. 🤦🏼

Starting over with dotnet new xunit3 and everything is working as expected, on 8.0.404 and 9.0.101:

Image

I would still love to know how my project got into this "MTP is always enabled" mode. I can package it up if you want to try to figure it out, because I'm at a bit of a loss.

@bradwilson
Copy link
Author

Repro project: vstest-10605-repro.zip

I was running dotnet test from the cs folder.

@bradwilson bradwilson changed the title Is there no way to get the pre-MTP dotnet test back with .NET SDK 8.0.404? How did I get myself into a place where Microsoft Testing Platform mode is always enabled with dotnet test? Dec 5, 2024
@Youssef1313
Copy link
Member

In the repro, you have <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> in cs.csproj. Is that intended?

@bradwilson
Copy link
Author

Image

I didn't know I'd put that there, and didn't even think to look there because I have everything like that stuffed into empty.proj. That's beyond embarrassing. 😂

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

No branches or pull requests

2 participants