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
Investigate test case association feature and its support with MTP #4477
It looks like this feature may be working by setting a VSTest property on TestCase, which means it may not work with MTP.
We need to investigate further.
Reacted by Amaury Levé, JoaoAntunes8210474, Jonas Arvidson, James Alickolli, elgatov, jangroendus, Michel Zehnder, Michael Koster, Daniel Gil and pcius-wayneb
Associate test cases in Test Explorer to AzDO test case, and an AzDO test case is part of a test plan.
Use VSTest AzDO task to run a given test plan by specifying testSelector: 'testPlan' and then specify the test plan they want to run.
What we need to do for MTP to support this:
Update Visual Studio to support associating test cases to AzDO test cases for MTP. We have a whitelisted set of adapters that we should include testingplatform-bridge in.
The NuGet package Microsoft.TeamFoundationServer.Client has APIs related to test plans. We need to figure out the exact API we need that exposes test cases in a given test plan (hopefully there will be something there in that package?).
We don't implement the support in an AzDO task. Instead, we create an AzDO test plan extension.
The test plan AzDO extension package will have a dependency on MS.TFS.Client
When the user specificies --azdo-test-plan, we will query the test plan, and use AddTestExecutionFilterFactory to construct a filter. But here, we will face an issue, as filters are not very well standardized, except for test node uids. I'm guessing that on VSTest, there was a special casing for MSTest/NUnit/xUnit when the filter is constructed.
Youssef Fahmy (@Youssef1313) The general flow you described is precisely the most common way we use the feature in our company.
We also have a dozen or so Azure Pipelines running tasks to request from the Azure DevOps API information on which test cases have the Automated status. Which is why this feature is very important to us (although we are probably not the only ones using the feature in this way).
Adding a concrete CI scenario in case it helps prioritize this.
Setup: MSTest.Sdk 4.4.1 / MTP 2.4.1, dotnet test on ubuntu-latest, results published with --report-azdo --publish-azdo-test-results. We'll set the test case associations in Azure DevOps directly (REST), so we don't depend on the Test Explorer part of this issue. We only need the pipeline to update the test plan.
Gap: for .NET, the only supported route today is VSTest mode on a Windows agent, i.e. leaving MTP:
--publish-azdo-test-results (as of 2.4.1) creates standalone runs, with no plan or test point options.
VSTest@3 (testSelector: testPlan) doesn't support MTP and only runs on Windows agents.
AzureTestPlan@0 supports Java, Python and JavaScript only.
What would unblock us: only the outcome write-back, as part of live publishing (option names are just illustrative):
dotnet test --project Tests.csproj --report-azdo --publish-azdo-test-results \
--publish-azdo-test-plan 1234 \
--publish-azdo-test-suite 5678 # optional, defaults to all suites in the plan
Read the plan's test points and each test case's Microsoft.VSTS.TCM.AutomatedTestName.
Create a run with plan + pointIds and post one result per point. Data rows share one AutomatedTestName, so use the worst outcome across rows, taking each row's final retry attempt.
In this publish-only mode, leave points without a result untouched: the run may be filtered (--filter), so a missing result shouldn't overwrite the point's last outcome.
Matching on the association rather than [WorkItem] / [TestProperty("TestCase", …)] (item 5 of the #5951 brainstorm) needs no code changes, and it's the same key VSTest@3 uses.
Activity
JoaoAntunes8210474 commentedon Jul 2, 2025
Youssef Fahmy (@Youssef1313) Hello sir, hope you are doing well!
Would you be able to give any information or any plans/dates for this feature being supported by MTP?
Youssef1313 commentedon Jul 2, 2025
Hi JoaoAntunes8210474
Unfortunately we didn't yet investigate what's needed to support this in MTP.
JoaoAntunes8210474 commentedon Jul 3, 2025
Hey Youssef Fahmy (@Youssef1313), hope you are doing well!
Would you be able to let me know if investigating how to support this feature in MTP is something that's planned for the near future?
It's a somewhat important feature for integrating tests with Azure DevOps' test cases.
nohwnd commentedon Jul 3, 2025
I don't have the technical details, I've reached out to ADO team to see if they can point me to the code that does it.
JoaoAntunes8210474 commentedon Jul 18, 2025
Jakub Jareš (@nohwnd) Hello sir, hope you are doing well!
Would you happen to have any updates regarding contacting the ADO team for information over how this feature was previously supported on VSTest?
nohwnd commentedon Jul 21, 2025
I got the supposed locations of the code, but did not get to investigate it yet, I will at best get to it next week.
Youssef1313 commentedon Jul 21, 2025
Related to #5951
I assume the general flow that users do is:
testSelector: 'testPlan'and then specify the test plan they want to run.What we need to do for MTP to support this:
--azdo-test-plan, we will query the test plan, and useAddTestExecutionFilterFactoryto construct a filter. But here, we will face an issue, as filters are not very well standardized, except for test node uids. I'm guessing that on VSTest, there was a special casing for MSTest/NUnit/xUnit when the filter is constructed.JoaoAntunes8210474 commentedon Jul 21, 2025
Youssef Fahmy (@Youssef1313) The general flow you described is precisely the most common way we use the feature in our company.
We also have a dozen or so Azure Pipelines running tasks to request from the Azure DevOps API information on which test cases have the Automated status. Which is why this feature is very important to us (although we are probably not the only ones using the feature in this way).
JoaoAntunes8210474 commentedon Aug 11, 2025
Jakub Jareš (@nohwnd) Hello sir, hope you are doing well!
Would you be able to tell us if you've had the opportunity to investigate this issue?
Youssef1313 commentedon Aug 11, 2025
Unfortunately, we didn't yet prioritize an implementation for this feature.
Youssef1313 commentedon Aug 11, 2025
FYI McKenna Barlow (@mckennabarlow)
elgatov commentedon Aug 26, 2025
This is preventing a very simple derived test method attribute from being associated with Azure Test Plans:
6 remaining items
nohwnd commentedon Dec 18, 2025
shepherdm3 Moved the UI issue here, microsoft/vstest#15348 let's discuss there, to not pollute this issue with it.
shepherdm3 commentedon Dec 18, 2025
This issue can be closed.
jangroendus commentedon Dec 31, 2025
I would like to thumb up this issue
JoaoAntunes8210474 commentedon Jan 19, 2026
Does MTP now support integrating test cases with Azure DevOps' test cases in Visual Studio?
Youssef1313 commentedon Jan 19, 2026
No, it's not yet supported for MTP.
DanielGilOrtiz commentedon Oct 7, 2026
Adding a concrete CI scenario in case it helps prioritize this.
Setup: MSTest.Sdk 4.4.1 / MTP 2.4.1,
dotnet testonubuntu-latest, results published with--report-azdo --publish-azdo-test-results. We'll set the test case associations in Azure DevOps directly (REST), so we don't depend on the Test Explorer part of this issue. We only need the pipeline to update the test plan.Gap: for .NET, the only supported route today is VSTest mode on a Windows agent, i.e. leaving MTP:
--publish-azdo-test-results(as of 2.4.1) creates standalone runs, with no plan or test point options.VSTest@3(testSelector: testPlan) doesn't support MTP and only runs on Windows agents.AzureTestPlan@0supports Java, Python and JavaScript only.What would unblock us: only the outcome write-back, as part of live publishing (option names are just illustrative):
Microsoft.VSTS.TCM.AutomatedTestName.automatedTestNamealready published (the FQN since Fix Azure DevOps published test identity #10706).plan+pointIdsand post one result per point. Data rows share oneAutomatedTestName, so use the worst outcome across rows, taking each row's final retry attempt.--filter), so a missing result shouldn't overwrite the point's last outcome.Matching on the association rather than
[WorkItem]/[TestProperty("TestCase", …)](item 5 of the #5951 brainstorm) needs no code changes, and it's the same keyVSTest@3uses.Happy to test a preview build.