Skip to content

Commit 914f8b1

Browse files
vazoisCopilot
andcommitted
Split cluster tests into 5 parallel CI projects
Split Garnet.test.cluster into separate projects to enable parallel CI: - Garnet.test.cluster: shared infra + basic cluster tests (144 tests) - Garnet.test.cluster.migrate: migrate + slot verification (67 tests) - Garnet.test.cluster.replication: all replication tests (372 tests) - Garnet.test.cluster.vectorsets: vector set cluster tests (30 tests) - Garnet.test.cluster.multilog: sharded log replication tests (163 tests) Child projects reference base via ProjectReference + InternalsVisibleTo. Updated CI and nightly workflow matrices to run all 5 in parallel. Fixed Allure wiring check to find AllureTestBase in referenced assemblies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6bc8124 commit 914f8b1

23 files changed

Lines changed: 223 additions & 4 deletions

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
os: [ ubuntu-latest, windows-latest ]
8585
framework: [ 'net8.0' , 'net10.0']
8686
configuration: [ 'Debug', 'Release' ]
87-
test: [ 'Garnet.test', 'Garnet.test.cluster' ]
87+
test: [ 'Garnet.test', 'Garnet.test.cluster', 'Garnet.test.cluster.migrate', 'Garnet.test.cluster.replication', 'Garnet.test.cluster.vectorsets', 'Garnet.test.cluster.multilog' ]
8888
if: needs.changes.outputs.garnet == 'true'
8989
steps:
9090
- name: Check out code
@@ -109,10 +109,19 @@ jobs:
109109
try {
110110
$types = $asm.GetTypes()
111111
} catch [System.Reflection.ReflectionTypeLoadException] {
112-
# Keep only successfully loaded types, skip nulls
113112
$types = $_.Exception.Types | Where-Object { $_ -ne $null }
114113
}
115114
$allureBase = $types | Where-Object { $_.Name -eq "AllureTestBase" }
115+
if (-not $allureBase) {
116+
# AllureTestBase may be in a referenced assembly (e.g., child test projects referencing a base test project)
117+
foreach ($refAsm in $asm.GetReferencedAssemblies()) {
118+
try {
119+
$loaded = [System.Reflection.Assembly]::Load($refAsm)
120+
$allureBase = $loaded.GetTypes() | Where-Object { $_.Name -eq "AllureTestBase" }
121+
if ($allureBase) { break }
122+
} catch { }
123+
}
124+
}
116125
117126
$bad = @()
118127
foreach ($t in $types) {

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
test: [ 'Garnet.test', 'Garnet.test.cluster', 'Tsavorite.test' ]
21+
test: [ 'Garnet.test', 'Garnet.test.cluster', 'Garnet.test.cluster.migrate', 'Garnet.test.cluster.replication', 'Garnet.test.cluster.vectorsets', 'Garnet.test.cluster.multilog', 'Tsavorite.test' ]
2222
os: [ ubuntu-latest, windows-latest ]
2323
framework: [ 'net8.0', 'net10.0' ]
2424
configuration: [ 'Debug', 'Release' ]

Garnet.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
<Folder Name="/test/">
7979
<Project Path="test/Garnet.fuzz/Garnet.fuzz.csproj" />
8080
<Project Path="test/Garnet.test.cluster/Garnet.test.cluster.csproj" />
81+
<Project Path="test/Garnet.test.cluster.migrate/Garnet.test.cluster.migrate.csproj" />
82+
<Project Path="test/Garnet.test.cluster.replication/Garnet.test.cluster.replication.csproj" />
83+
<Project Path="test/Garnet.test.cluster.vectorsets/Garnet.test.cluster.vectorsets.csproj" />
84+
<Project Path="test/Garnet.test.cluster.multilog/Garnet.test.cluster.multilog.csproj" />
8185
<Project Path="test/Garnet.test/Garnet.test.csproj" />
8286
</Folder>
8387
</Solution>

playground/TstRunner/TstRunner.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
<ItemGroup>
2323
<ProjectReference Include="..\..\test\Garnet.test.cluster\Garnet.test.cluster.csproj" />
24+
<ProjectReference Include="..\..\test\Garnet.test.cluster.migrate\Garnet.test.cluster.migrate.csproj" />
25+
<ProjectReference Include="..\..\test\Garnet.test.cluster.replication\Garnet.test.cluster.replication.csproj" />
2426
<ProjectReference Include="..\..\test\Garnet.test\Garnet.test.csproj" />
2527
</ItemGroup>
2628

test/Garnet.test.cluster/ClusterMigrateTLSTests.cs renamed to test/Garnet.test.cluster.migrate/ClusterMigrateTLSTests.cs

File renamed without changes.
File renamed without changes.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<SignAssembly>true</SignAssembly>
5+
<AssemblyOriginatorKeyFile>../../Garnet.snk</AssemblyOriginatorKeyFile>
6+
<DelaySign>false</DelaySign>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<NoWarn>1701;1702;1591</NoWarn>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<None Include="..\testcerts\testcert.pfx" Link="testcert.pfx">
15+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16+
</None>
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="Allure.Net.Commons" />
21+
<PackageReference Include="Allure.NUnit" />
22+
<PackageReference Include="CommandLineParser" />
23+
<PackageReference Include="Microsoft.CodeAnalysis" />
24+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
26+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
27+
<PackageReference Include="NUnit" />
28+
<PackageReference Include="NUnit3TestAdapter">
29+
<PrivateAssets>all</PrivateAssets>
30+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
31+
</PackageReference>
32+
<PackageReference Include="StackExchange.Redis" />
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<ProjectReference Include="..\..\libs\client\Garnet.client.csproj" />
37+
<ProjectReference Include="..\..\libs\cluster\Garnet.cluster.csproj" />
38+
<ProjectReference Include="..\..\libs\common\Garnet.common.csproj" />
39+
<ProjectReference Include="..\..\libs\host\Garnet.host.csproj" />
40+
<ProjectReference Include="..\..\libs\server\Garnet.server.csproj" />
41+
<ProjectReference Include="..\..\libs\storage\Tsavorite\cs\src\devices\AzureStorageDevice\Tsavorite.devices.AzureStorageDevice.csproj" />
42+
<ProjectReference Include="..\Garnet.test.cluster\Garnet.test.cluster.csproj" />
43+
</ItemGroup>
44+
45+
<PropertyGroup>
46+
<AspectInjector_Enabled>false</AspectInjector_Enabled>
47+
</PropertyGroup>
48+
</Project>

test/Garnet.test.cluster/RedirectTests/BaseCommand.cs renamed to test/Garnet.test.cluster.migrate/RedirectTests/BaseCommand.cs

File renamed without changes.

test/Garnet.test.cluster/RedirectTests/ClusterSlotVerificationTests.cs renamed to test/Garnet.test.cluster.migrate/RedirectTests/ClusterSlotVerificationTests.cs

File renamed without changes.

test/Garnet.test.cluster/RedirectTests/TestClusterProc.cs renamed to test/Garnet.test.cluster.migrate/RedirectTests/TestClusterProc.cs

File renamed without changes.

0 commit comments

Comments
 (0)