Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLVS-1758 Parallelize all non-ui unit tests #5936

Merged
merged 8 commits into from
Jan 7, 2025
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)
Loading