Skip to content

Commit 5fd1659

Browse files
authored
Use sharding in CI workflows (#619)
* Bump block numbers * Use vitest sharding in CI workflow * Remove non-archive radiumblock endpoint for BridgeHub Kusama * Merge sharded test reports and shard update-known-good workflow - ci.yml: add --reporter=blob per shard, upload as artifact, and a merge-reports job that combines them via vitest --merge-reports so the run summary shows one unified set of test totals instead of one section per shard. - update-known-good.yml: shard the tests matrix 3 ways to match ci.yml, and disambiguate the failed-chains artifact name by shard so the notify job downloads all per-(network, shard) reports without collisions. * Replace pruned Bulletin endpoint with bulletin-rpc.polkadot.io The previous amperfix endpoint has pruned state at PET's pinned block (probed live: UnknownBlock error in 136ms). bulletin-rpc.polkadot.io serves the same block in 110ms. simplystaking's spectrum endpoint is also pruned and not used. * Disambiguate blob report filenames per (network, shard) Vitest's default blob filename is blob-${shard}-${total}.json, which collides across networks when 'actions/download-artifact' merges all artifacts into one directory. Each shard now writes to a uniquely named file, so the merge-reports job can parse all six blobs without the JSON-after-JSON SyntaxError seen in run 26061812546.
1 parent a057cc0 commit 5fd1659

3 files changed

Lines changed: 49 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ jobs:
3636

3737
ecosystem-tests:
3838
needs: define-matrix
39-
name: "Tests (${{ matrix.network.name }})"
39+
name: "Tests (${{ matrix.network.name }}, shard ${{ matrix.shard }}/3)"
4040
runs-on: ubuntu-latest
41-
timeout-minutes: 150
41+
timeout-minutes: 60
4242
strategy:
4343
fail-fast: false
4444
matrix:
4545
network: ${{ fromJSON(needs.define-matrix.outputs.networks) }}
46+
shard: [1, 2, 3]
4647
steps:
4748
- uses: actions/checkout@v5
4849

@@ -130,8 +131,22 @@ jobs:
130131
echo "${ENDPOINT_VAR}=ws://localhost:${PORT}" >> $GITHUB_ENV
131132
done
132133
133-
- name: Run ${{ matrix.network.name }} tests
134-
run: yarn test:${{ matrix.network.name }} --pool=forks --maxWorkers=8 --retry=3
134+
# Reporters: verbose+github-actions keep live per-shard output and
135+
# job-summary annotations; blob writes a binary report per shard that
136+
# the merge-reports job below combines into a single unified summary.
137+
# Blob filename includes (network, shard) so multi-network artifacts
138+
# don't collide on merge-multiple download.
139+
- name: Run ${{ matrix.network.name }} tests (shard ${{ matrix.shard }}/3)
140+
run: yarn test:${{ matrix.network.name }} --pool=forks --maxWorkers=8 --retry=2 --shard=${{ matrix.shard }}/3 --reporter=verbose --reporter=github-actions --reporter=blob --outputFile=.vitest-reports/blob-${{ matrix.network.name }}-${{ matrix.shard }}.json
141+
142+
- name: Upload blob report
143+
if: ${{ !cancelled() }}
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: blob-report-${{ matrix.network.name }}-${{ matrix.shard }}
147+
path: .vitest-reports/*
148+
include-hidden-files: true
149+
retention-days: 1
135150

136151
- name: Cleanup Subway instances
137152
if: always()
@@ -147,6 +162,29 @@ jobs:
147162
fi
148163
done
149164
165+
# Merges per-shard blob reports into one unified job summary so the run page
166+
# shows a single set of test totals instead of one section per shard.
167+
merge-reports:
168+
needs: ecosystem-tests
169+
if: ${{ !cancelled() }}
170+
runs-on: ubuntu-latest
171+
steps:
172+
- uses: actions/checkout@v5
173+
- name: Use Node.js
174+
uses: actions/setup-node@v6
175+
with:
176+
node-version: 22.x
177+
cache: 'yarn'
178+
- run: yarn --immutable
179+
- name: Download blob reports
180+
uses: actions/download-artifact@v4
181+
with:
182+
path: .vitest-reports
183+
pattern: blob-report-*
184+
merge-multiple: true
185+
- name: Merge reports
186+
run: yarn vitest --merge-reports --reporter=github-actions --reporter=verbose
187+
150188
all-passed:
151189
runs-on: ubuntu-latest
152190
needs: ecosystem-tests

.github/workflows/update-known-good.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ jobs:
5858
# Vitest retries each failing test 3 times (--retry=3).
5959
tests:
6060
needs: define-matrix
61-
name: "Tests (${{ matrix.network.name }})"
62-
timeout-minutes: 150
61+
name: "Tests (${{ matrix.network.name }}, shard ${{ matrix.shard }}/3)"
62+
timeout-minutes: 60
6363
strategy:
6464
fail-fast: false
6565
matrix:
6666
network: ${{ fromJSON(needs.define-matrix.outputs.networks) }}
67+
shard: [1, 2, 3]
6768
runs-on: ubuntu-latest
6869
steps:
6970
- uses: actions/checkout@v5
@@ -163,8 +164,8 @@ jobs:
163164
164165
# --reporter=json writes test results to file for chain extraction below
165166
# --reporter=verbose keeps human-readable output in the CI log
166-
- name: Run ${{ matrix.network.name }} tests
167-
run: yarn test:${{ matrix.network.name }} --pool=threads --maxWorkers=3 --retry=3 --reporter=json --outputFile=test-results.json --reporter=verbose
167+
- name: Run ${{ matrix.network.name }} tests (shard ${{ matrix.shard }}/3)
168+
run: yarn test:${{ matrix.network.name }} --pool=threads --maxWorkers=3 --retry=3 --shard=${{ matrix.shard }}/3 --reporter=json --outputFile=test-results.json --reporter=verbose
168169

169170
# Parse Vitest JSON output to find which chains had failing tests.
170171
# Test filenames encode chain names as dot-separated segments, e.g.
@@ -196,7 +197,7 @@ jobs:
196197
if: failure()
197198
uses: actions/upload-artifact@v4
198199
with:
199-
name: failed-chains-${{ matrix.network.name }}
200+
name: failed-chains-${{ matrix.network.name }}-${{ matrix.shard }}
200201
path: failed-chains.json
201202
retention-days: 1
202203

packages/networks/src/pet-chain-endpoints.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"wss://dot-rpc.stakeworld.io/coretime"
4949
],
5050
"bulletinPolkadot": [
51-
"wss://bulletin.amperfix.de"
51+
"wss://bulletin-rpc.polkadot.io"
5252
],
5353
"peoplePolkadot": [
5454
"wss://sys.ibp.network/people-polkadot",
@@ -94,7 +94,6 @@
9494
"wss://statemine.public.curie.radiumblock.co/ws"
9595
],
9696
"bridgeHubKusama": [
97-
"wss://bridgehub-kusama.public.curie.radiumblock.co/ws",
9897
"wss://sys.ibp.network/bridgehub-kusama",
9998
"wss://bridge-hub-kusama.dotters.network",
10099
"wss://rpc-bridge-hub-kusama.luckyfriday.io",

0 commit comments

Comments
 (0)