Skip to content

Commit

Permalink
SLVS-1758 Parallelize all non-ui unit tests (#5936)
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent 65ca7ac commit 6b8ac72
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/CFamily.UnitTests/CFamily.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

<!-- **************************************************************** -->
<!-- HACK to make the C++ rule loader tests work -->
Expand Down
6 changes: 6 additions & 0 deletions src/Core.UnitTests/Core.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
<ProjectReference Include="..\TestInfrastructure\TestInfrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Education.UnitTests/Education.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@
<ProjectReference Include="..\TestInfrastructure\TestInfrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@
<ProjectReference Include="..\Progress\Progress.csproj" />
<ProjectReference Include="..\TestInfrastructure\TestInfrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Integration.UnitTests/Integration.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@
<ProjectReference Include="..\Integration\Integration.csproj" />
<ProjectReference Include="..\TestInfrastructure\TestInfrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@
<ProjectReference Include="..\TestInfrastructure\TestInfrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.11.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/SLCore.IntegrationTests/SLCore.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,10 @@
</None>
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
</PackageReference>
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/SLCore.UnitTests/SLCore.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
<ProjectReference Include="..\TestInfrastructure\TestInfrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/SonarQube.Client.Tests/SonarQube.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@
</None>
</ItemGroup>

<ItemGroup>
<Compile Include="..\TestInfrastructure\TestParallelization.cs">
<Link>TestParallelization.cs</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#if DEBUG
[assembly:Parallelize(Workers = 4, Scope = ExecutionScope.ClassLevel)] // method level is not safe, as SLCore instance are shared inside the test classes
#endif
[assembly:Parallelize(Workers = 4, Scope = ExecutionScope.ClassLevel)] // method level is not safe as multiple test classes rely on global setup (for example, SLCore integration tests)

0 comments on commit 6b8ac72

Please sign in to comment.