Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Visual Studio 2012 has a new feature where it automatically runs your unit tests after every build.

I would like to use this feature, but I have a number of tests that should not be run after every build (long running performance tests, etc).

Is there a way to define which categories are run automatically? Or some other way to define which test should be run?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

A colleague of mine wanted to know the answer to this question also.

He asked Cathy Sullivan (A Microsoft Visual Studio Program manager) on Twitter whether it was possible.

Cathy came back and said that unfortunately, it's not possible, however as part of the same conversation, Joshua Weber (another MS VS Program Manager) stated that Visual Studio's "Run Tests On Build" will honor any current filter you've applied within the search box.

(Image grab of twitter conversation)

share|improve this answer
    
Thanks. Do you know if it is possible to filter by test category on the search box? –  oillio Sep 9 '12 at 17:04
2  
If anyone is interested, this is how I am making this work: I couldn't find any way to filter by category. The best I found was the FullName filter, which will filter for any string in the namespace, class, or method name. I am adding the text "AutoRun" to the class name of all the tests I want to run continuously. In the Test Explorer, I search for: FullName:"AutoRun". Then the "Run Tests After Build" feature works perfect. –  oillio Sep 10 '12 at 16:26

After update 1, you can filter on categories in the search box using the trait filter. See this blog post for more info.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.