4

Before you point me out the other questions please read on...

I am running a mstest argument from Jenkins (not sure if this at all relevant) and want to exclude tests that do not belong in a particular category. Including tests in a category works a treat using the /category:CI but when i use it to exclude test using /category:!CI it doesnot work. It just says no tests to execute. I am %110 sure that there are tests in my container that are not in this category. I am using mstest test for VS2010.

mstest.exe /testcontainer:%%i /runconfig:%TestSettingFile% /category:"!CI" /resultsfile:Results.trx

Any idea what I might be doing wrong

EDIT I have found that this command doesn't work when running it from Jenkins but it works fine through cmd on the local box - any current bugs with Jenkins in regards to this?

AltF4_
  • 2,312
  • 5
  • 36
  • 56
  • 1
    Apparently there is a known issue with MSTest+Jenkins when there are spaces in the path to mstest.exe. Try changing the path to it (in Jenkins config) to DOS style `...\PROGRA~1\mstest\etc` or use Windows Batch Command instead. – meatspace Jan 19 '15 at 15:42
  • There definitely looks to be a problem there - Do you know the item number or a link to this issue on Jenkins? – AltF4_ Jan 19 '15 at 17:15
  • Looks like using "Execute Windows batch command" could be a way forward: http://stackoverflow.com/questions/21112717/error-trying-to-run-mstest-on-jenkins – Jocke Jan 19 '15 at 22:11

1 Answers1

5

Interestingly enough putting the category as the last argument seemed to have worked. Try moving the arguments if you are seeing the same issue.

EDIT

I only leave the answer above as a reference even though it is totally incorrect.

As it turns out Jenkins batch command ignores " ! " mark so to escape it i had to use a " ^ " character.

so my category is now listed as /category:"^!CI"

AltF4_
  • 2,312
  • 5
  • 36
  • 56