You are here because you are looking for syntax and details to pass runsettings configurations to either vstest.console.exe or dotnet test through commandline.
RunSettings arguments are used to add/update specific runsettings configurations. The updated runsettings configurations will be available to TestPlatform and test extensions (E.g. test adapter, etc.) through runsettings.
RunSettings argumentsare specified as name-value pair of the form[name]=[value]after--. Note the space after --.- Use a space to separate multiple
[name]=[value]. - All the arguments after
--will be treated asRunSettings arguments, meansRunSettings argumentsshould be at the end of the command line.
Passing argument -- MSTest.MapInconclusiveToFailed=True in (1) below is equivalent to passing argument
--settings additionalargs.runsettings in (2) below.
1) dotnet test -- MSTest.MapInconclusiveToFailed=True MSTest.DeploymentEnabled=False2) dotnet test --settings additionalargs.runsettingswhere additionalargs.runsettings is:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- MSTest adapter -->
<MSTest>
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
<DeploymentEnabled>False</DeploymentEnabled>
</MSTest>
</RunSettings> The syntax in (1) is another way of passing runsettings configuration and you need not author a runsetting file while using Runsettings arguments. More details about runsettings can be found here.
Runsettings arguments takes precedence over runsettings.
For example, in below command the final value for MapInconclusiveToFailed will be False and value for DeploymentEnabled will be unchanged, that is False.
dotnet test --settings additionalargs.runsettings -- MSTest.MapInconclusiveToFailed=FalseYou can also set TestRunParameters using command line option:
# cmd
dotnet test -- TestRunParameters.Parameter(name=\"myParam\", value=\"value\")
# powershell
dotnet test --% -- TestRunParameters.Parameter(name=\"myParam\", value=\"value\")
# bash
dotnet test -- TestRunParameters.Parameter\(name=\"myParam\",\ value=\"value\"\) In this example, \"myParam\" corresponds to the name of you parameter and \"value\" - the value of your parameter. Note, that \ are escaping characters and they should stay as shown above.