You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide ManagedType/ManagedMethod VSTest properties #1259
@OsirisTerje I'm planning to remove the vstestprovider capability from VSTestBridge. This removal will (for now - this may change in future) require frameworks that use the bridge to provide the ManagedType/ManagedMethod properties. Would you have any soon plans to add that?
@OsirisTerje Let me expand more. Usually in MTP there is TestMethodIdentifierProperty. Currently we don't provide it in the bridge, and without ManagedType/ManagedMethod, we don't have a good way to provide it. For you, that will mean any extension trying to make use of that information won't work with NUnit.
Can you point me to some documentation on the ManagedType/ManagedMethod? Is this the same as the older FQN system you have?
What are we missing - I believed you already got that information from NUnit ?
So what you're saying is that the adapter will no more be the item that supports the MTP, but it has to be built into the framework ?
@OsirisTerje So, to give a bit of history, Test Explorer used to use FullyQualifiedName to determine the source information for test cases. But this was never standardized, which makes it harder to use to provide source information. Later, a spec for ManagedType/ManagedMethod was introduced (putting aside that it could have been designed in a better way).
Be able to drop vstestProvider from VSTestBridge. So far, Test Explorer provides source information for NUnit by using FullyQualifiedName, which has some tricks on Test Explorer side that can't be easily replicated on MTP side. With ManagedType/ManagedMethod, it will be easier for VSTestBridge to be able to create TestMethodIdentifierProperty and finally drop vstestProvider.
You are aware that the naming of NUnit tests are much wider (in syntax) than what FQN will allow?
I didn't dig into all the possible shapes of FQN that NUnit can produce, but I knew that NUnit specifically is a bit different in this area than MSTest and xunit.
Could we just add the real NUnit test name into the ManagedMethod property ?
Use of ManagedMethod should be done together with ManagedType (both should be set - not one of them), and they must strictly be calculated by ManagedNameHelper in AdapterUtilities.
How does this play out with the Real Time Discovery feature?
I'm planning to remove the vstestprovider capability from VSTestBridge. This removal will (for now - this may change in future) require frameworks that use the bridge to provide the ManagedType/ManagedMethod properties.
Does this mean you expect these to be done in the NUnit Framework ? If so, I am not sure if that will happen @manfred-brands@stevenaw@jnm2
They can be added in the adapter, or in a NUnitLite (NextGen) extension for dotnet test. Is that what you expect ?
If we will remove vstestProvider, then yes we expect these properties to be provided by NUnit. To be more precise, we expect it to be available at this point.
Activity
OsirisTerje commentedon Apr 16, 2025
Currently no, but I have to admit I haven't looked into the different possibilities we have with the VSTestBridge.
Youssef1313 commentedon Apr 16, 2025
@OsirisTerje Let me expand more. Usually in MTP there is
TestMethodIdentifierProperty. Currently we don't provide it in the bridge, and without ManagedType/ManagedMethod, we don't have a good way to provide it. For you, that will mean any extension trying to make use of that information won't work with NUnit.OsirisTerje commentedon Apr 29, 2025
Can you point me to some documentation on the ManagedType/ManagedMethod? Is this the same as the older FQN system you have?
What are we missing - I believed you already got that information from NUnit ?
So what you're saying is that the adapter will no more be the item that supports the MTP, but it has to be built into the framework ?
Youssef1313 commentedon Apr 29, 2025
@OsirisTerje So, to give a bit of history, Test Explorer used to use
FullyQualifiedNameto determine the source information for test cases. But this was never standardized, which makes it harder to use to provide source information. Later, a spec for ManagedType/ManagedMethod was introduced (putting aside that it could have been designed in a better way).Today, there are public helpers exposed via AdapterUtilities package (https://github.com/microsoft/vstest/blob/2e6d9288d3aa0269ae710844f3aa9e0a3981b26e/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs#L14) that helps construct ManagedType/ManagedMethod given MethodInfo.
The properties are expected to be defined like this, then set normally as any other VSTest property.
On VSTestBridge, this will allow us to be able to:
TestMethodIdentifierProperty, which can be accessed by MTP extensions (e.g, test loggers like what I started in Add support for Microsoft.Testing.Platform spekt/testlogger#172 (see here)OsirisTerje commentedon Apr 29, 2025
@Youssef1313 Ok, those are added in the adapter - that is good, and it seems trivial to get those in. Thanks for those links.
You are aware that the naming of NUnit tests are much wider (in syntax) than what FQN will allow? We have a lot of issues related to that, and have been trying to force the names into some sort of FQN, but it is like squeezing a football into a keyhole.....
Some of the issues are here: https://github.com/nunit/nunit3-vs-adapter/issues?q=is%3Aissue%20state%3Aopen%20label%3Ais%3AFQNIssue
Could we just add the real NUnit test name into the ManagedMethod property ?
How does this play out with the Real Time Discovery feature?
And to answer your question at the top - we should be able to get this into the 5.1 adapter. I'll try to get it done during the long weekend now.
Youssef1313 commentedon Apr 30, 2025
I didn't dig into all the possible shapes of FQN that NUnit can produce, but I knew that NUnit specifically is a bit different in this area than MSTest and xunit.
Use of ManagedMethod should be done together with ManagedType (both should be set - not one of them), and they must strictly be calculated by
ManagedNameHelperin AdapterUtilities.Likely no impact for real-time discovery.
OsirisTerje commentedon May 25, 2025
@Youssef1313
You wrote:
Youssef1313 commentedon May 28, 2025
If we will remove
vstestProvider, then yes we expect these properties to be provided by NUnit. To be more precise, we expect it to be available at this point.Youssef1313 commentedon May 28, 2025
Keep in mind that VSTestBridge will never add
TestMethodIdentifierPropertyif ManagedType/ManagedMethod are not available.So any extensions that will make use of
TestMethodIdentifierPropertyare not going to work with NUnit.