-1

My project has some Nunit tests with certain tags called categories.

For example: 32 bit app tests have x32 as tag and 64 bit app tests have x64 as tag.

Now using vstest task i am able to run tests for one category like this:

TestCategory=x32

when I want to run multiple categories in same task I gave TestCategory=x32,x64 and it didn't work. The task failed without any errors in the console.

I even tried

TestCategory=x32|x64: in this case only x64 tests are ran.  
TestCategory=x32,x64: test task failed without any errors

Any idea on how to provide multiple categories ?

Dan Mullin
  • 4,285
  • 2
  • 18
  • 34

1 Answers1

3

How to provide multiple test categories in vstest task in azure pipelines

According to the document /category option:

  • /category:"group1|group2" runs tests that are in test category "group1" or "group2". Tests that are in both test categories will also be run.

To use this with VS Test task, we could specify it like following:

TestCategory=x32|TestCategory=x64

Update:

but, i need to run all the tests which are present in both categories. is this possible?

If you want to run all the tests which are present in both categories, you could try to use following in the vstest task:

TestCategory=x32&TestCategory=x64
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • I guess this option will run either of 2 test categories and tests that are present in both categories (intersection fof 2 categories). but, i need to run all the tests which are present in both categories. is this possible? – sai kartheek challa Aug 20 '20 at 16:41
  • there is a bit of confusion in the wording i guess. what I am trying to achieve is. for example x32 category of tests have T1, T2 tests and x64 has T3,T4 tests. Now I need to run T1,T2,T3,T4 all of them. – sai kartheek challa Aug 21 '20 at 15:58
  • @saikartheekchalla, um, Isn't this your initial question? You just use the `TestCategory=x32|TestCategory=x64`, it will execute all the tests under the x32 category and x64. – Leo Liu Aug 24 '20 at 01:32