-
Notifications
You must be signed in to change notification settings - Fork 273
VSTestBridge+MSTest: Use TestMethodIdentifierProperty and stop sending VSTest-specifics #5409
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
base: main
Are you sure you want to change the base?
Conversation
At least for MSTest, ManagedMethod has parameter types, while FullyQualifiedName doesn't. So, prefer ManagedMethod/ManagedType when they are set.
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Outdated
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Platform/ServerMode/ClientHelpers.cs
Outdated
Show resolved
Hide resolved
e21d711
to
f6c9ff8
Compare
@@ -17,17 +16,14 @@ namespace Microsoft.Testing.Extensions.VSTestBridge.UnitTests.ObjectModel; | |||
[TestClass] | |||
public sealed class ObjectModelConvertersTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I deleted some tests here when I was removing vstestProvider completely. In the current PR status, some logic is brought back, and I need to plug the tests back per the updated logic (we add the vstest properties under vstestProvider named capability + JsonRpc server mode).
cc314ba
to
16615b4
Compare
16615b4
to
fb351b6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5409 +/- ##
==========================================
- Coverage 76.24% 73.82% -2.43%
==========================================
Files 603 602 -1
Lines 36420 36467 +47
==========================================
- Hits 27770 26923 -847
- Misses 8650 9544 +894
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs
Show resolved
Hide resolved
testNode.Properties.Add(methodIdentifierProperty); | ||
} | ||
|
||
CopyVSTestProperties(testCase.Properties, testNode, testCase, testCase.GetPropertyValue, isTrxEnabled, ShouldAddVSTestProviderProperties(serviceProvider)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
if (TryGetMethodIdentifierProperty(testCase, out TestMethodIdentifierProperty? methodIdentifierProperty))
testNode.Properties.Add(methodIdentifierProperty);
else if (ShouldAddVSTestProviderProperties(serviceProvider)) // check here about vstest properties rather than inside CopyVSTestProperties function
CopyVSTestProperties(testCase.Properties, testNode, testCase, testCase.GetPropertyValue, isTrxEnabled)
else
throw exception?,
Maybe a check as well. If test framework sends both managed and vstest properties, then we can stop or warn them,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSTestDiscoverer.TestCategory
needs to be copied regardless. It could be separated out of CopyVSTestProperties though, but we do it while we are looping already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A suggestion then. Maybe we can rename CopyVSTestProperties to something generic CopyProperties and then pass different flags ShouldAddVSTestProviderProperties
, ShouldCopySomething
.
@@ -44,12 +65,10 @@ public static TestNode ToTestNode(this TestCase testCase, bool isTrxEnabled, ICl | |||
} | |||
|
|||
private static void CopyVSTestProperties(IEnumerable<TestProperty> testProperties, TestNode testNode, TestCase testCase, Func<TestProperty, object?> getPropertyValue, | |||
bool isTrxEnabled, IClientInfo client) | |||
bool isTrxEnabled, bool addVSTestProviderProperties) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not like the idea of having bool addVSTestProviderProperties
here. By just looking at the name CopyVSTestProperties
, this function should not do anything if addVSTestProviderProperties = false
. So, why someone should call it with false
?
I would prefer to have
if (addVstestProperties)
CopyVSTestProperties(...);
rather than
CopyVSTestProperties(..., false);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
MSTestDiscoverer.TestCategory
needs to be copied regardless.
Fixes #5406
@drognanar Any concerns?
location.type
.