Skip to content

Commit 136e3fd

Browse files
author
Terje Sandstrom
committed
Updated mstest properties
1 parent 563fb38 commit 136e3fd

File tree

11 files changed

+60
-37
lines changed

11 files changed

+60
-37
lines changed

AllTemplate/AllRunSettings.runsettings

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
-->
2525
<!-- 0 = As many processes as possible, limited by number of cores on machine, 1 = Sequential (1 process), 2-> Given number of processes up to limit by number of cores on machine-->
2626
<MaxCpuCount>0</MaxCpuCount>
27+
<DisableParallelization>false</DisableParallelization>
2728
<!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
2829
<!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
2930
<TestSessionTimeout>10000</TestSessionTimeout>
@@ -155,21 +156,22 @@ Included items must then not match any entries in the exclude list to remain inc
155156

156157
<!-- MSTest adapter -->
157158
<MSTest>
158-
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
159-
<CaptureTraceOutput>false</CaptureTraceOutput>
160-
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
161-
<DeploymentEnabled>False</DeploymentEnabled>
162-
<!-- Uncomment and update path for assembly resolution -->
163-
<!-- <AssemblyResolution>
164-
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
165-
</AssemblyResolution> -->
166-
<!--In-assembly parallel, see https://devblogs.microsoft.com/devops/mstest-v2-in-assembly-parallel-test-execution/ and https://www.meziantou.net/mstest-v2-execute-tests-in-parallel.htm -->
167-
<!--
168-
<Parallelize>
169-
<Workers>0</Workers>
170-
<Scope>MethodLevel</Scope>
171-
</Parallelize>
172-
-->
159+
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
160+
<CaptureTraceOutput>true</CaptureTraceOutput>
161+
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
162+
<DeploymentEnabled>true</DeploymentEnabled>
163+
<AssemblyResolution>false</AssemblyResolution>
164+
<!-- Uncomment and update path for assembly resolution -->
165+
<!-- <AssemblyResolution>
166+
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
167+
</AssemblyResolution> -->
168+
<ForcedLegacyMode>false</ForcedLegacyMode>
169+
<IgnoreTestImpact>false</IgnoreTestImpact>
170+
<!--
171+
<SettingsFile>some file (require ForcedLegacyMode true) </SettingsFile>
172+
-->
173+
<KeepExecutorAliveAfterLegacyRun>false</KeepExecutorAliveAfterLegacyRun>
174+
<InProcMode>false</InProcMode>
173175
</MSTest>
174176

175177
<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->

AllTemplate/AllRunSettings.zip

12 Bytes
Binary file not shown.

CoverageNoParallelTemplate/CoverageNoParallel.runsettings

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
<!-- 0 = As many processes as possible, limited by number of cores on machine, 1 = Sequential (1 process), 2-> Given number of processes up to limit by number of cores on machine-->
3030
<MaxCpuCount>1</MaxCpuCount>
31+
<DisableParallelization>true</DisableParallelization>
3132
<!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
3233
<!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
3334
<TestSessionTimeout>10000</TestSessionTimeout>
@@ -159,14 +160,22 @@ Included items must then not match any entries in the exclude list to remain inc
159160

160161
<!-- MSTest adapter -->
161162
<MSTest>
162-
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
163-
<CaptureTraceOutput>false</CaptureTraceOutput>
164-
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
165-
<DeploymentEnabled>False</DeploymentEnabled>
163+
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
164+
<CaptureTraceOutput>true</CaptureTraceOutput>
165+
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
166+
<DeploymentEnabled>true</DeploymentEnabled>
167+
<AssemblyResolution>false</AssemblyResolution>
166168
<!-- Uncomment and update path for assembly resolution -->
167169
<!-- <AssemblyResolution>
168-
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
169-
</AssemblyResolution> -->
170+
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
171+
</AssemblyResolution> -->
172+
<ForcedLegacyMode>false</ForcedLegacyMode>
173+
<IgnoreTestImpact>false</IgnoreTestImpact>
174+
<!--
175+
<SettingsFile>some file (require ForcedLegacyMode true) </SettingsFile>
176+
-->
177+
<KeepExecutorAliveAfterLegacyRun>false</KeepExecutorAliveAfterLegacyRun>
178+
<InProcMode>false</InProcMode>
170179
</MSTest>
171180

172181
<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->
131 Bytes
Binary file not shown.

ItemTemplates/AllRunSettings.zip

12 Bytes
Binary file not shown.
131 Bytes
Binary file not shown.

ItemTemplates/parallel.zip

42 Bytes
Binary file not shown.

ParallelTemplate/parallel.runsettings

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<RunConfiguration>
66
<!-- 0 = As many processes as possible, limited by number of cores on machine, 1 = Sequential (1 process), 2-> Given number of processes up to limit by number of cores on machine-->
77
<MaxCpuCount>0</MaxCpuCount>
8+
<!-- Disables in-assembly parallel execution, applies to both MSTest and NUnit -->
9+
<DisableParallelization>false</DisableParallelization>
810
</RunConfiguration>
911

1012
<!--
@@ -18,21 +20,22 @@
1820

1921
<!-- MSTest adapter -->
2022
<MSTest>
21-
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
22-
<CaptureTraceOutput>false</CaptureTraceOutput>
23-
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
24-
<DeploymentEnabled>False</DeploymentEnabled>
23+
<MapInconclusiveToFailed>false</MapInconclusiveToFailed>
24+
<CaptureTraceOutput>true</CaptureTraceOutput>
25+
<DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
26+
<DeploymentEnabled>true</DeploymentEnabled>
27+
<AssemblyResolution>false</AssemblyResolution>
2528
<!-- Uncomment and update path for assembly resolution -->
2629
<!-- <AssemblyResolution>
27-
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
28-
</AssemblyResolution> -->
29-
<!--In-assembly parallel, see https://devblogs.microsoft.com/devops/mstest-v2-in-assembly-parallel-test-execution/ and https://www.meziantou.net/mstest-v2-execute-tests-in-parallel.htm -->
30-
<!--
31-
<Parallelize>
32-
<Workers>0</Workers>
33-
<Scope>MethodLevel</Scope>
34-
</Parallelize>
35-
-->
30+
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
31+
</AssemblyResolution> -->
32+
<ForcedLegacyMode>false</ForcedLegacyMode>
33+
<IgnoreTestImpact>false</IgnoreTestImpact>
34+
<!--
35+
<SettingsFile>some file (require ForcedLegacyMode true) </SettingsFile>
36+
-->
37+
<KeepExecutorAliveAfterLegacyRun>false</KeepExecutorAliveAfterLegacyRun>
38+
<InProcMode>false</InProcMode>
3639
</MSTest>
3740

3841
<!-- NUnit3 adapter, uncomment sections to set as appropriate, numeric, booleans, enums have their default values below, except RandomSeed -->

ParallelTemplate/parallel.zip

42 Bytes
Binary file not shown.

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ A solution item template that creates a set of default runsettings files under S
1313

1414
The runsettings file is used to change the code coverage analysis settings for a test run, in particular which files to be included and excluded from analysis,  and also used to set symbol search paths.  It can also set Runconfigurations and testrunparameters, and specific settings for NUnit and MSTest. 
1515

16+
### Parallel execution
1617
It can also enable [parallel run of unit tests](https://blogs.msdn.microsoft.com/visualstudioalm/2016/02/08/parallel-and-context-sensitive-test-execution-with-visual-studio-2015-update-1/).
18+
More information on [MSTest parallel execution](https://devblogs.microsoft.com/devops/mstest-v2-in-assembly-parallel-test-execution) and [more details here](https://github.com/microsoft/testfx-docs/blob/master/RFCs/004-In-Assembly-Parallel-Execution.md)
19+
More information on [NUnit parallel execution](https://github.com/nunit/docs/wiki/Parallelizable-Attribute)
1720

18-
There are 3 templates included, one complete which includes code coverage and parallel run, one with only code coverage, and one with only parallel run.
21+
### Templates
22+
There are 3 templates included, one complete which includes code coverage and parallel run, one with only code coverage, and one with only parallel run. The latter can also be used as the most simple runsettings template.
1923

2024
See this blogpost for more information :[How to exclude code from code coverage in Visual Studio](http://hermit.no/how-to-exclude-code-from-code-coverage-in-visual-studio-unit-testing-using-runsettings/) 
2125

26+
The current version supperts VS2017 and VS2019.
27+
28+
#### Versions supporting older Visual Studio versions:
29+
2230
[VS 2015 version ](https://marketplace.visualstudio.com/items?itemName=OsirisTerje.Runsettings)
2331

2432
[VS 2013 version ](/vsgallery/704ebd18-7d60-4341-9224-532f73229c74)

0 commit comments

Comments
 (0)