Skip to content

Commit 6e83642

Browse files
committed
Enable parallel test execution via shared target
Moved the ParallelizeAttribute configuration from individual test project files to the shared Community.Toolkit.Common.targets file. This centralizes the configuration and ensures all test projects run tests in parallel by default.
1 parent d2ceba9 commit 6e83642

File tree

12 files changed

+5
-44
lines changed

12 files changed

+5
-44
lines changed

build/Community.Toolkit.Common.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616
<None Include="$(RepositoryDirectory)ThirdPartyNotices.txt" Pack="true" PackagePath="\" Visible="False" />
1717
</ItemGroup>
1818

19+
<!-- Run tests in parallel by default -->
20+
<ItemGroup Condition="$(IsTestProject)">
21+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute"/>
22+
</ItemGroup>
23+
1924
</Project>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
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-
1713
<ItemGroup>
1814
<ProjectReference Include="..\..\src\CommunityToolkit.Common\CommunityToolkit.Common.csproj" />
1915
</ItemGroup>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
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-
1713
<ItemGroup>
1814
<ProjectReference Include="..\..\src\CommunityToolkit.Diagnostics\CommunityToolkit.Diagnostics.csproj" />
1915
</ItemGroup>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
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-
1713
<ItemGroup>
1814
<PackageReference Include="MSTest.TestAdapter" Version="4.0.1" />
1915
<PackageReference Include="MSTest.TestFramework" Version="4.0.1" />

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
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-
1713
<ItemGroup>
1814
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
1915
<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: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
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-
1713
<ItemGroup>
1814
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
1915
</ItemGroup>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
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-
2117
<ItemGroup>
2218
<ProjectReference Include="..\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4001\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4001.csproj" />
2319
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
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-
2117
<ItemGroup>
2218
<ProjectReference Include="..\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031.csproj" />
2319
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
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-
2622
<ItemGroup>
2723
<ProjectReference Include="..\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn4031.csproj" />
2824
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
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-
2016
<ItemGroup>
2117
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
2218
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001.csproj" />

0 commit comments

Comments
 (0)