Skip to content
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

[BUG]: VSTest@2 MSTest data-driven tests are all rerun when any subcase fails #20914

Open
4 of 7 tasks
brandondong opened this issue Mar 8, 2025 · 0 comments
Open
4 of 7 tasks

Comments

@brandondong
Copy link

New issue checklist

Task name

VSTest

Task version

2

Issue Description

Is this expected behavior?

[TestMethod]
[DataRow(true, true)]
[DataRow(true, false)]
[DataRow(false, true)]
[DataRow(false, false)]
[TestCategory("UnitTests_PipelineTest")]
public void DataRowBoolTest(bool b1, bool b2)
{
    Console.WriteLine($"Starting DataRow bool test with {b1}, {b2}");
    if (b1 && b2)
    {
        Console.WriteLine($"Failing DataRow bool test with {b1}, {b2}");
        Assert.Fail("DataRow bool test fail");
    }
    Console.WriteLine($"Passing DataRow bool test with {b1}, {b2}");
}

With rerunFailedTests: true, all 4 test cases are rerun even though only (true, true) is failing. I would personally expect only the (true, true) to be rerun.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows 11

Relevant log output

N/A

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants