问题
In order to automate unit tests on TeamCity I had to create a test list in my vsmdi
configuration file indicating that every test is part of a list I called CompleteCoverage
. I dislike this a lot because in order to auto-run new tests I'll have to remember to include them on this list.
Is there some way to run every test in the solution using TeamCity and MSBuild (other than explicitly referencing the path to the output test assembly)?
Should I just drop MSTest and go for NUnit?
回答1:
I'm using NUnit instead of MSTest, but this should work for you, too:
I've named all my test assemblies to include .NUnit in their name, e.g. Basic.NUnit.dll. In the build step performing the tests, I've declared **/*.NUnit.dll as the assemblies to run. To make sure that they are run in the right location, I've added **/obj/**/*.NUnit.dll to the exclude list. Together with test categories to in- or exclude, I've got perfect control over which tests to run on a purely declarative level without to name the individual tests.
来源:https://stackoverflow.com/questions/9746917/teamcity-mstest-and-testlist