AxoCover icon indicating copy to clipboard operation
AxoCover copied to clipboard

AxoCover does not detect TestClasses marked with `DoNotParallelize`

Open Steinblock opened this issue 6 years ago • 0 comments

I am using MSTest V2 because of the great InAssembly Test parallelization feature and use axocover for code coverage. While most of my tests are thread safe, some of them can't be run in parallel. To avoid random failueres I marked the test classes with the DoNotParallelizeAttribute

Stepls to reproduce

  • Create a new Unit Test Project (.NET Framework) C# with a current version of Visual Studio 2017. The project will reference MSTest V2 Assemblies from NuGet MSTest.TestAdapter 1.3.2 and MSTest.TestFramework 1.3.2
  • Create a Test Class
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
    }
    [TestClass]
    public class UnitTest2
    {
        [TestMethod]
        public void TestMethod2()
        {
            Assert.IsTrue(true);
        }
    }
    
  • Build the project, AxoCover will detect and execute your test as expected image
  • Add the [DoNotParallelizeAttribute] to UnitTest1 and rebuild your project. AxoCover will fail to discover the test(s) from UnitTest1. image

Steinblock avatar May 27 '19 08:05 Steinblock