In Visual Studio Team Services (VSTS) when defining a build I can filter specific tests to be included or excluded when running tests.
Question: How do I filter complete test classes from execution? The example in the screenshot demonstrates how I filter tests based on their category.
Sample test class which I'd like to exclude:
[TestClass] // .NET 4.5
public class SampleTests
{
[TestMethod, TestCategory("Integration")]
public void Test1() {}
[TestMethod, TestCategory("Integration")]
public void Test2() {}
...
}
Current configuration to exclude my integration tests:
Trial: The filter criteria ClassName!=SampleTests
doesn't work. It seems to be reserved for store apps only. Fairly good documentation here: MSDN Blog by Vikram Agrawal.
Reason for asking: I've got test classes initialize lots of data first before running any test and run a clean-up job at the end. When all my tests are excluded via the aforesaid filter the class initialization and clean-up still happen which consumes a lot of time and resources. I like to optimize this.