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

Test methods with generic parameters don't show source locations in Microsoft.Testing.Platform mode in Test Explorer #3863

Open
bradwilson opened this issue Sep 25, 2024 · 4 comments

Comments

@bradwilson
Copy link

bradwilson commented Sep 25, 2024

When xUnit.net v3 test projects are in Microsoft Testing Platform mode, source information is missing when the test method parameter is generic.

Recording.2024-09-24.210427.mp4

Reproduced with:

  • VS 2022 17.12 Preview 2
  • NuGet package xunit.v3 version 0.4.0-pre.20
@bradwilson bradwilson changed the title Generic test methods don't show source locations in Microsoft.Testing.Platform mode in Test Explorer Test methods with generic parameters don't show source locations in Microsoft.Testing.Platform mode in Test Explorer Sep 25, 2024
@bradwilson
Copy link
Author

bradwilson commented Sep 28, 2024

On a hunch, I brought back my implementation of https://github.com/microsoft/vstest/blob/main/docs/RFCs/0017-Managed-TestCase-Properties.md and now everything is working as expected.

I don't remember what issue it was in, but someone from the VSTest team told me this was outdated and no longer needed. That information appeared to be incorrect.

So...what's the story here? Is this working right now because Test Explorer hasn't been updated yet? Or is this working right now because the advice to just use .FullName was incorrect?

/cc @MarcoRossignoli

Here's 2022 17.11 in VSTest mode:

image

Here's 2022 17.12 Preview 2 in MTP mode:

image

@bradwilson
Copy link
Author

I set up a branch for the changes: https://github.com/xunit/xunit/tree/testfx-3863

@bradwilson
Copy link
Author

I don't remember what issue it was in, but someone from the VSTest team told me this was outdated and no longer needed.

Found it: #3478 (comment)

@bradwilson
Copy link
Author

Also, if this is the answer:

Is this working right now because Test Explorer hasn't been updated yet?

Then what is the migration path forward? Will Test Explorer support both styles into the future so as to preserve backward compatibility with test frameworks that are emitting the "VSTest" style vs. the "FullName" style? If so, for how long? We obviously don't want to unnecessarily degrade users who are stuck on older builds of Visual Studio that might still be supported.

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

No branches or pull requests

1 participant