|
11 | 11 | target: |
12 | 12 | description: "Which test suite(s) to stress" |
13 | 13 | required: true |
14 | | - default: "both" |
| 14 | + default: "all" |
15 | 15 | type: choice |
16 | 16 | options: |
17 | 17 | - unit |
18 | 18 | - selftests |
19 | | - - both |
| 19 | + - integration |
| 20 | + - all |
20 | 21 | shards: |
21 | 22 | description: "Number of parallel runners (iterations are divided across shards)" |
22 | 23 | required: true |
|
60 | 61 | unit-tests: |
61 | 62 | name: Unit (shard ${{ matrix.shard }}) |
62 | 63 | needs: plan |
63 | | - if: ${{ inputs.target == 'unit' || inputs.target == 'both' }} |
| 64 | + if: ${{ inputs.target == 'unit' || inputs.target == 'all' }} |
64 | 65 | runs-on: windows-latest |
65 | 66 | timeout-minutes: 350 |
66 | 67 | strategy: |
@@ -113,7 +114,7 @@ jobs: |
113 | 114 | selftests: |
114 | 115 | name: Selftests (shard ${{ matrix.shard }}) |
115 | 116 | needs: plan |
116 | | - if: ${{ inputs.target == 'selftests' || inputs.target == 'both' }} |
| 117 | + if: ${{ inputs.target == 'selftests' || inputs.target == 'all' }} |
117 | 118 | runs-on: windows-latest |
118 | 119 | timeout-minutes: 350 |
119 | 120 | strategy: |
@@ -163,22 +164,77 @@ jobs: |
163 | 164 | } |
164 | 165 | Write-Host "Shard ${idx}: $count iterations passed." |
165 | 166 |
|
| 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 | +
|
166 | 220 | summary: |
167 | 221 | name: Stress summary |
168 | | - needs: [plan, unit-tests, selftests] |
| 222 | + needs: [plan, unit-tests, selftests, integration-tests] |
169 | 223 | if: ${{ always() }} |
170 | 224 | runs-on: ubuntu-latest |
171 | 225 | steps: |
172 | 226 | - name: Report |
173 | 227 | env: |
174 | 228 | UNIT_RESULT: ${{ needs.unit-tests.result }} |
175 | 229 | SELFTESTS_RESULT: ${{ needs.selftests.result }} |
| 230 | + INTEGRATION_RESULT: ${{ needs.integration-tests.result }} |
176 | 231 | 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" |
179 | 235 | fail=0 |
180 | 236 | # '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 |
182 | 238 | case "$r" in |
183 | 239 | success|skipped|"") ;; |
184 | 240 | *) fail=1 ;; |
|
0 commit comments