Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify custom parameters, using xunit.runner.console

Tags:

I have a C#/Selenium/Specflow test suite which I am running using Jenkins using xunit.console.exe. I need to point these tests to different environments (Test/QA/Prod etc.) and would like to use a command line parameter.

The batch command I am calling is: "%WORKSPACE%\packages\xunit.runner.console.2.1.0\tools\xunit.console" "%WORKSPACE%\[MyProject]\bin\Debug\eDC6.Test.Specs.dll" -xml test_output.xml

and would like to include an extra parameter like: "-env=PROD" to point that job to a specific environment.

I am open to better ways to do this.

like image 870
Malcolm Avatar asked Aug 15 '16 09:08

Malcolm


People also ask

What is xUnit runner Visualstudio?

xunit.runner.visualstudio. This package contains the VSTest runner. This runner is capable of running . NET Framework projects from xUnit.net v1 and v2, and . NET Core and UWP projects projects from xUnit.net v2.

What is xUnit runner JSON?

xunit. runner. json (where <AssemblyName> is the name of your unit test assembly, without the file extension like . dll or .exe ). You should only need to use this longer name format if your unit tests DLLs will all be placed into the same output folder, and you need to disambiguate the various configuration files.


1 Answers

For this solution the extra command-line gives me more flexibility:

"%WORKSPACE%\packages\xunit.runner.console.2.1.0\tools\xunit.console" "%WORKSPACE%[MyProject]\bin\Debug\eDC6.Test.Specs.dll" -TargEnv QAConfig.json - xml test_output.xml

like image 198
Malcolm Avatar answered Sep 25 '22 16:09

Malcolm