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

Inconsistency with DiaSession between MSTest and xUnit.net (as well as VSTest vs. Microsoft Testing Platform) #10356

Closed
bradwilson opened this issue Sep 13, 2024 · 1 comment

Comments

@bradwilson
Copy link

Quick summary of the problem:

We use DiaSession to map types to source in xunit.runner.visualstudio:
https://github.com/xunit/visualstudio.xunit/blob/main/src/xunit.runner.visualstudio/Utility/DiaSessionWrapper.cs
https://github.com/xunit/visualstudio.xunit/blob/main/src/xunit.runner.visualstudio/Utility/DiaSessionWrapperHelper.cs

(You can safely ignore the AppDomain gymnastics, as the bug report is using .NET 8.)

We get no source information when a test method comes from a base class in another assembly. MSTest does not have this problem, and I glanced at the source to ensure that they too are relying on DiaSession, so this probably comes down to me not understanding how I'm supposed to be using it in this scenario.

Also worth noting that everything works fine when we are in Microsoft Testing Platform mode (rather than VSTest mode), because in that scenario we don't ever see or invoke DiaSession; I assume MTP is doing all the source mapping under the hood for us, so it's also doing the right thing.

Any hints what I'm doing wrong in this scenario? Should I be trying to recurse up through the base classes when I get back "no answer" for a type?

For reference, the user issue with a repro project: xunit/xunit#3023

@nohwnd
Copy link
Member

nohwnd commented Sep 23, 2024

Tried to transfer, it is still being transferred, but this is imho TE issue xunit/xunit#3023 (comment)

@nohwnd nohwnd closed this as completed Sep 23, 2024
This issue is being transferred. Timeline may not be complete until it finishes.
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