How to exclude certain tests in the Visual Studio Test Runner?

前端 未结 7 1123
春和景丽
春和景丽 2020-12-09 01:45

I have attributes on certain tests that I ideally don\'t want to run on every build. Most of my tests are normal unit tests and I do want them to run on every build.

7条回答
  •  一生所求
    2020-12-09 02:20

    A bit late to the partyI had the same issue where all developers were confronted with disruptive CodedUI when just running all unit tests in a solution. My workaround is to add the following to the AssemblyInitializer of the CodedUI Project:

        if(!ConfigurationManager.AppSettings["MachinesToRunCodedUI"].Split(',').Contains(Environment.MachineName))
            Assert.Inconclusive("CodedUI Tests are skipped.");
    

    Only when a machine is part of that MachinesToRunCodedUI list, it will run the CodedUI tests.

提交回复
热议问题