Skip to content

Commit d2ceba9

Browse files
committed
Enable parallel test execution in MSTest projects
Added the Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute to all MSTest-based unit test project files to enable parallel test execution. This change should improve test run performance by allowing tests to run concurrently.
1 parent 8ef7009 commit d2ceba9

File tree

11 files changed

+44
-0
lines changed

11 files changed

+44
-0
lines changed

tests/CommunityToolkit.Common.UnitTests/CommunityToolkit.Common.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
15+
</ItemGroup>
16+
1317
<ItemGroup>
1418
<ProjectReference Include="..\..\src\CommunityToolkit.Common\CommunityToolkit.Common.csproj" />
1519
</ItemGroup>

tests/CommunityToolkit.Diagnostics.UnitTests/CommunityToolkit.Diagnostics.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
15+
</ItemGroup>
16+
1317
<ItemGroup>
1418
<ProjectReference Include="..\..\src\CommunityToolkit.Diagnostics\CommunityToolkit.Diagnostics.csproj" />
1519
</ItemGroup>

tests/CommunityToolkit.HighPerformance.UnitTests/CommunityToolkit.HighPerformance.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<ProjectReference Include="..\..\src\CommunityToolkit.HighPerformance\CommunityToolkit.HighPerformance.csproj" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
15+
</ItemGroup>
16+
1317
<ItemGroup>
1418
<PackageReference Include="MSTest.TestAdapter" Version="4.0.1" />
1519
<PackageReference Include="MSTest.TestFramework" Version="4.0.1" />

tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
15+
</ItemGroup>
16+
1317
<ItemGroup>
1418
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
1519
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" PrivateAssets="contentfiles;build" />

tests/CommunityToolkit.Mvvm.Internals.UnitTests/CommunityToolkit.Mvvm.Internals.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
15+
</ItemGroup>
16+
1317
<ItemGroup>
1418
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
1519
</ItemGroup>

tests/CommunityToolkit.Mvvm.Roslyn4001.UnitTests/CommunityToolkit.Mvvm.Roslyn4001.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<PackageReference Include="System.Text.Json" Version="8.0.5" />
1515
</ItemGroup>
1616

17+
<ItemGroup>
18+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
19+
</ItemGroup>
20+
1721
<ItemGroup>
1822
<ProjectReference Include="..\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4001\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4001.csproj" />
1923
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />

tests/CommunityToolkit.Mvvm.Roslyn4031.UnitTests/CommunityToolkit.Mvvm.Roslyn4031.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<PackageReference Include="System.Text.Json" Version="8.0.5" />
1515
</ItemGroup>
1616

17+
<ItemGroup>
18+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
19+
</ItemGroup>
20+
1721
<ItemGroup>
1822
<ProjectReference Include="..\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031.csproj" />
1923
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />

tests/CommunityToolkit.Mvvm.Roslyn4120.UnitTests/CommunityToolkit.Mvvm.Roslyn4120.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<PackageReference Include="System.Text.Json" Version="8.0.5" />
2020
</ItemGroup>
2121

22+
<ItemGroup>
23+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
24+
</ItemGroup>
25+
2226
<ItemGroup>
2327
<ProjectReference Include="..\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031.csproj" />
2428
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<PackageReference Include="MSTest.TestFramework" Version="4.0.1" />
1414
</ItemGroup>
1515

16+
<ItemGroup>
17+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
18+
</ItemGroup>
19+
1620
<ItemGroup>
1721
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
1822
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001.csproj" />

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<PackageReference Include="MSTest.TestFramework" Version="4.0.1" />
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
23+
</ItemGroup>
24+
2125
<ItemGroup>
2226
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
2327
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.csproj" />

0 commit comments

Comments
 (0)