Skip to content

Commit 216b8fe

Browse files
ci(stress): add integration test target to ci-stress workflow
Adds an integration-tests job to ci-stress.yml that mirrors the existing unit/selftests stress matrix but builds and runs Reactor.IntegrationTests. Replaces the 'both' target choice with 'all' (unit + selftests + integration); each suite can also be stressed individually. Summary job now reports all three results. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 80381b0 commit 216b8fe

1 file changed

Lines changed: 64 additions & 8 deletions

File tree

.github/workflows/ci-stress.yml

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ on:
1111
target:
1212
description: "Which test suite(s) to stress"
1313
required: true
14-
default: "both"
14+
default: "all"
1515
type: choice
1616
options:
1717
- unit
1818
- selftests
19-
- both
19+
- integration
20+
- all
2021
shards:
2122
description: "Number of parallel runners (iterations are divided across shards)"
2223
required: true
@@ -60,7 +61,7 @@ jobs:
6061
unit-tests:
6162
name: Unit (shard ${{ matrix.shard }})
6263
needs: plan
63-
if: ${{ inputs.target == 'unit' || inputs.target == 'both' }}
64+
if: ${{ inputs.target == 'unit' || inputs.target == 'all' }}
6465
runs-on: windows-latest
6566
timeout-minutes: 350
6667
strategy:
@@ -113,7 +114,7 @@ jobs:
113114
selftests:
114115
name: Selftests (shard ${{ matrix.shard }})
115116
needs: plan
116-
if: ${{ inputs.target == 'selftests' || inputs.target == 'both' }}
117+
if: ${{ inputs.target == 'selftests' || inputs.target == 'all' }}
117118
runs-on: windows-latest
118119
timeout-minutes: 350
119120
strategy:
@@ -163,22 +164,77 @@ jobs:
163164
}
164165
Write-Host "Shard ${idx}: $count iterations passed."
165166
167+
integration-tests:
168+
name: Integration (shard ${{ matrix.shard }})
169+
needs: plan
170+
if: ${{ inputs.target == 'integration' || inputs.target == 'all' }}
171+
runs-on: windows-latest
172+
timeout-minutes: 350
173+
strategy:
174+
fail-fast: false
175+
matrix:
176+
shard: ${{ fromJSON(needs.plan.outputs.shard-list) }}
177+
steps:
178+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
179+
180+
- name: Setup .NET
181+
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
182+
with:
183+
dotnet-version: 10.0.x
184+
185+
- name: Restore
186+
run: dotnet restore Reactor.slnx
187+
188+
- name: Build (once)
189+
run: dotnet build tests/Reactor.IntegrationTests/Reactor.IntegrationTests.csproj --no-restore --configuration Debug
190+
191+
- name: Stress loop
192+
shell: pwsh
193+
env:
194+
PER_SHARD: ${{ needs.plan.outputs.per-shard }}
195+
REMAINDER: ${{ needs.plan.outputs.remainder }}
196+
SHARD_INDEX: ${{ matrix.shard }}
197+
run: |
198+
$per = [int]$env:PER_SHARD
199+
$rem = [int]$env:REMAINDER
200+
$idx = [int]$env:SHARD_INDEX
201+
$count = if ($idx -le $rem) { $per + 1 } else { $per }
202+
if ($count -lt 1) { Write-Host "Shard $idx has no work."; exit 0 }
203+
$failures = New-Object System.Collections.Generic.List[int]
204+
for ($i = 1; $i -le $count; $i++) {
205+
Write-Host "::group::Integration iteration $i / $count (shard $idx)"
206+
dotnet test tests/Reactor.IntegrationTests/Reactor.IntegrationTests.csproj --no-restore --no-build --logger "console;verbosity=normal"
207+
$code = $LASTEXITCODE
208+
Write-Host "::endgroup::"
209+
if ($code -ne 0) {
210+
Write-Host "::warning::Integration iteration $i (shard $idx) failed with exit $code"
211+
$failures.Add($i) | Out-Null
212+
}
213+
}
214+
if ($failures.Count -gt 0) {
215+
Write-Host "::error::Shard $idx had $($failures.Count) failed iteration(s): $($failures -join ', ')"
216+
exit 1
217+
}
218+
Write-Host "Shard ${idx}: $count iterations passed."
219+
166220
summary:
167221
name: Stress summary
168-
needs: [plan, unit-tests, selftests]
222+
needs: [plan, unit-tests, selftests, integration-tests]
169223
if: ${{ always() }}
170224
runs-on: ubuntu-latest
171225
steps:
172226
- name: Report
173227
env:
174228
UNIT_RESULT: ${{ needs.unit-tests.result }}
175229
SELFTESTS_RESULT: ${{ needs.selftests.result }}
230+
INTEGRATION_RESULT: ${{ needs.integration-tests.result }}
176231
run: |
177-
echo "Unit shards: $UNIT_RESULT"
178-
echo "Selftest shards: $SELFTESTS_RESULT"
232+
echo "Unit shards: $UNIT_RESULT"
233+
echo "Selftest shards: $SELFTESTS_RESULT"
234+
echo "Integration shards: $INTEGRATION_RESULT"
179235
fail=0
180236
# 'skipped' is OK (target filter); 'success' is OK; anything else is a fail.
181-
for r in "$UNIT_RESULT" "$SELFTESTS_RESULT"; do
237+
for r in "$UNIT_RESULT" "$SELFTESTS_RESULT" "$INTEGRATION_RESULT"; do
182238
case "$r" in
183239
success|skipped|"") ;;
184240
*) fail=1 ;;

0 commit comments

Comments
 (0)