Override MSTest Parameters in RunSettings file

186 views Asked by At

I have a .runsettings file that contains the following.

    <?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
    <!-- MSTest adapter -->
    <MSTest>
        <Parallelize>
            <Workers>1</Workers>
            <Scope>ClassLevel</Scope>
        </Parallelize>
    </MSTest>
</RunSettings>

Is it possible to override the Workers and Scope settings from the VsTest@2 task in an Azure DevOps pipeline?

The documentation for the VsTest@2 task only mentions overriding TestRunParameters.

1

There are 1 answers

0
Yiannis On

I tried that and seems that you just have to add your value in the command line, e.g. for overriding only the workers:

dotnet test --settings:.runsettings -- MSTest.Parallelize.Workers=3

or for overriding both workers & scope

dotnet test --settings:.runsettings -- MSTest.Parallelize.Workers=3 MSTest.Parallelize.Scope=MethodLevel