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
This SDK opts into the MTP vstestProvider capability here: src/YoloDev.Expecto.TestSdk/TestApplicationHelpers.fs.
Background
When a test app runs in Microsoft.Testing.Platform (MTP) server mode (how Visual Studio Test Explorer talks to it), the VSTest bridge can expose test metadata to the IDE in two ways:
Legacyvstest.TestCase.* properties (e.g. vstest.TestCase.Id, vstest.TestCase.FullyQualifiedName), serialized via an internalSerializableKeyValuePairStringProperty key/value bag.
Public, structured property types — in particular TestMethodIdentifierProperty, which serializes to the well-known location.type / location.method / location.method-arity wire properties.
VS picks which path to consume based purely on the server-advertised vstestProvider capability. This adapter currently opts into vstestProvider (by registering VSTestBridgeExtensionBaseCapabilities, whose INamedFeatureCapability.IsSupported("vstestProvider") returns true), which forces VS onto path #1 — the legacy internal KVP.
The testfx / VS Test Explorer team is working to deprecate and remove that internal KVP and have all IDE metadata flow through public property types. MSTest has already moved off the vstestProvider path; NUnit and Expecto are the only two adapters still using it.
Opts out of vstestProvider by registering a capability that does not implement INamedFeatureCapability — see MSTestCapabilities. VS then routes MSTest through the public-properties path.
What we'd like here
Mirror MSTest:
Override AddAdditionalProperties in this adapter's bridged framework to add a TestMethodIdentifierProperty (namespace, type, method, arity) so the structured location.type / location.method properties are emitted.
Unlike MSTest, NUnit/Expecto don't have ECMA-335 managed names, and (for NUnit) the FQN encodes parameter values (Ns.Cls.Method(x: 1)) that TestMethodIdentifierProperty (method name + arity, no argument values) can't represent. Declaration-level identity (navigation/grouping) is fine from location.type/location.method; per-row identity should rely on the public TestNode.Uid (already unique per data row).
Please don't flip off vstestProvider before the public path is lossless — the VS + testfx side changes that make VS consume everything from the public properties need to land first. Happy to coordinate sequencing so this doesn't regress navigation / Test Case association.
I'm on the testfx / VS Test Explorer side and glad to help with the change or review. Filing this so the dependency is tracked.
This SDK opts into the MTP
vstestProvidercapability here:src/YoloDev.Expecto.TestSdk/TestApplicationHelpers.fs.Background
When a test app runs in Microsoft.Testing.Platform (MTP) server mode (how Visual Studio Test Explorer talks to it), the VSTest bridge can expose test metadata to the IDE in two ways:
vstest.TestCase.*properties (e.g.vstest.TestCase.Id,vstest.TestCase.FullyQualifiedName), serialized via an internalSerializableKeyValuePairStringPropertykey/value bag.TestMethodIdentifierProperty, which serializes to the well-knownlocation.type/location.method/location.method-aritywire properties.VS picks which path to consume based purely on the server-advertised
vstestProvidercapability. This adapter currently opts intovstestProvider(by registeringVSTestBridgeExtensionBaseCapabilities, whoseINamedFeatureCapability.IsSupported("vstestProvider")returnstrue), which forces VS onto path #1 — the legacy internal KVP.The testfx / VS Test Explorer team is working to deprecate and remove that internal KVP and have all IDE metadata flow through public property types. MSTest has already moved off the
vstestProviderpath; NUnit and Expecto are the only two adapters still using it.How MSTest does it (the model to follow)
MSTest does two things:
TestMethodIdentifierPropertyby overriding the bridge hookAddAdditionalProperties(which isvirtualand empty by default) — seeMSTestBridgedTestFramework.AddAdditionalProperties+GetMethodIdentifierPropertyFromManagedTypeAndManagedMethod. This is what lets VS recover namespace / class / method (navigation, grouping, FQN) without anyvstest.TestCase.*KVP.vstestProviderby registering a capability that does not implementINamedFeatureCapability— seeMSTestCapabilities. VS then routes MSTest through the public-properties path.What we'd like here
Mirror MSTest:
AddAdditionalPropertiesin this adapter's bridged framework to add aTestMethodIdentifierProperty(namespace, type, method, arity) so the structuredlocation.type/location.methodproperties are emitted.vstestProvideropt-in once Enable sourcelink #1 is in place.Caveats / things to coordinate
Ns.Cls.Method(x: 1)) thatTestMethodIdentifierProperty(method name + arity, no argument values) can't represent. Declaration-level identity (navigation/grouping) is fine fromlocation.type/location.method; per-row identity should rely on the publicTestNode.Uid(already unique per data row).vstestProviderbefore the public path is lossless — the VS + testfx side changes that make VS consume everything from the public properties need to land first. Happy to coordinate sequencing so this doesn't regress navigation / Test Case association.I'm on the testfx / VS Test Explorer side and glad to help with the change or review. Filing this so the dependency is tracked.