0

So I have a fairly large amount of UI tests I kick off using NUnit, and in order to control what tests are ran in what environments, we use a test list.

The test list currently contains a list of tests that are included in the test run, but I would rather it specify tests that it should no run instead since the amount is much lower and will be easier to keep up with. I use the NUnit command line runner, this is my command.

"Project\bin\KahuaLFT.dll" --testlist="Project\Main\Utilities\TestSuites\BETA.txt" --where "cat = 'Smoke'" --params "Env=BETA"

The BETA.txt lists out all the tests that will be included, but is there a way to change this so it instead ignores the tests specified in the --testlist?

Tree55Topz
  • 1,102
  • 4
  • 20
  • 51
  • Doesn't seem to be anything [in the docs](https://github.com/nunit/docs/wiki/Console-Command-Line) to suggest that's possible. – stuartd May 22 '18 at 13:23
  • Yep I would agree with you there, hoping there is someone out there that may have a creative solution :D – Tree55Topz May 22 '18 at 13:46

1 Answers1

0

I was looking at doing something similar, and while I never implemented it I thought I'd share my idea...

  • execute the nunit-console-runner with the --where parameter and without the --testlist parameter, and add the --explore parameter. This will not run any tests but will return the list of tests to be executed

So for your example it would be:

nunit-console.exe "Project\bin\KahuaLFT.dll" --where "cat = 'Smoke'" --expore="testlist.txt;format=cases"
  • Take the text file returned by the previous statement, open with Powershell, or whatever you prefer, and remove any entries that match your list in BETA.txt
  • Call nunit-console again, passing in the modified testlist.txt as the --testlist parameter
Pablo Claus
  • 5,886
  • 3
  • 29
  • 38