TestAdapter: Wrongly grouped DataTestMethod
See original GitHub issueDescribe the bug
DataTestMethods are wrongly grouped with MSTest.TestAdapter in version 3.0.x (Grouping in VS is by Traits)
Wrong grouping:
Expected grouping (achieved with MSTest.TestAdapter 2.2.x):
Steps To Reproduce
Explore tests in this class:
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TestProject
{
[TestClass]
[TestCategory("L3")]
public class BasicUnitTest : UnitTestBase
{
public override int TypeCount => 3;
}
[TestClass]
[TestCategory("L3")]
public class ExtendedUnitTest : UnitTestBase
{
public override int TypeCount => 8;
}
[TestClass]
[TestCategory("L3")]
public class UnitTestBase
{
public virtual int TypeCount => 5;
[DataRow(1)]
[DataRow(2)]
[DataTestMethod]
public void DocumentCostCurrentDataFunctions(int count)
{
Assert.IsTrue(count < TypeCount);
}
}
}
Expected behavior
Expected grouping (achieved with MSTest.TestAdapter 2.2.x):
Actual behavior
Wrong grouping:
Additional context
We also run tests in Azure DevOps wth vstest.console.exe "C:\abc.dll" /TestCaseFilter:"TestCategory=L3" "/logger:trx;LogFileName=C:\abc.trx" /TestAdapterPath:"C:\UnitTests\Tests"
command. The test report file has changed after the libraries update.
Issue Analytics
- State:
- Created 5 months ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Wrongly grouped DataTestMethod · microsoft/testfx@68c9dfb
Search code, repositories, users, issues, pull requests... · Provide feedback · Saved searches · TestAdapter: Wrongly grouped DataTestMethod ...
Read more >DataTestMethod and DataRow attributes in MSTEST
In a nutshell, you will need to install MSTest.TestFramework and MSTest.TestAdapter , and remove references to Microsoft.VisualStudio.
Read more >Create Data-Driven Unit Tests - Visual Studio (Windows)
Learn how to use the Microsoft unit test framework for managed code to set up a unit test method to retrieve values from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I put the comment to the linked issue. Thank you for being so helpful!
Hi @HightowerCZ,
I am waiting for a little more info about the change of behaviour in VS because it’s not yet fully clear if this is coming from a change caused by MSTest or VS Test Explorer. I will let you know more when I have some news.
Regarding the change in the trx, this is not linked to traits grouping but linked to a change of behavior (breaking change) that was introduced in 2.2.4. This is unfortunate but sadly we cannot easily change this on our side because we need to synchronize with Azure DevOps team to ensure the UI will reflect the change. To get more information about this change, I encourage you to refer to https://github.com/microsoft/testfx/issues/1024.