While running unit tests as part of Azure CI pipeline (YAML)
- task: DotNetCoreCLI@2 displayName: Run Test Processor inputs: command: 'test'
Test methods [DataTestMethod] are not executed. But [TestMethod] is working fine.
While running unit tests as part of Azure CI pipeline (YAML)
Test methods [DataTestMethod] are not executed. But [TestMethod] is working fine.
The following yaml works fine on the newest version of Azure Devops (cloud).
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: path/to/.csproj
arguments: '--configuration $(BuildConfiguration)'
Make sure it also works fine on your local machine to avoid it being any issues with the code.
To answer your bonus question
" Well you can either add a test category and filter it on the category, or filter it on the test projects if you have multiple of them.
I would probably do it with test categories
[Category("MainTest")]
[Test]
public void TestMethod1()
{
Assert.True(true);
}
And then in your yaml you should be able to do something like
testFiltercriteria: 'TestCategory=MainTest'
"