-
Notifications
You must be signed in to change notification settings - Fork 16
209 lines (178 loc) · 6.9 KB
/
Copy pathintegration-test.yml
File metadata and controls
209 lines (178 loc) · 6.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changes:
uses: ./.github/workflows/check-changed-files.yml
permissions:
contents: read
pull-requests: read
set-image:
if: needs.changes.outputs.should-run == 'true'
needs: [changes]
uses: ./.github/workflows/set-image.yml
# Pre-warm the binary cache once before the matrix fan-out so all matrix
# legs hit the cache instead of racing to download/build.
setup:
if: needs.changes.outputs.should-run == 'true'
needs: [changes, set-image]
name: Setup
runs-on: parity-large
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder zombienet
mode: prepare
runtime-matrix:
if: needs.changes.outputs.should-run == 'true'
needs: [changes]
runs-on: ubuntu-latest
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
name: Extract tasks from matrix
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- id: runtime
run: |
TASKS=$(jq '[.[] | select(.integration_tests == true)]' scripts/runtimes-matrix.json)
SKIPPED=$(jq '[.[] | select(.integration_tests != true)]' scripts/runtimes-matrix.json)
echo "--- Running integration tests for ---"
echo "$TASKS"
echo "--- Skipping integration tests for ---"
echo "$SKIPPED"
TASKS=$(echo "$TASKS" | jq -c .)
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
integration-tests:
needs: [set-image, setup, runtime-matrix]
name: Integration Tests (${{ matrix.runtime.name }})
runs-on: parity-large
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
timeout-minutes: 200
strategy:
fail-fast: false
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder zombienet
mode: consume
- name: Rust cache (Bulletin)
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: .
shared-key: "bulletin-cache-bulletin-integration-tests"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: |
examples/package.json
console-ui/package-lock.json
- name: Install subxt-cli
run: |
if ! command -v subxt &> /dev/null; then
cargo install subxt-cli --locked
else
echo "subxt-cli already installed"
fi
- name: Start services
working-directory: examples
env:
RUNTIME_PACKAGE: ${{ matrix.runtime.package }}
run: |
TEST_DIR="$(mktemp -d $GITHUB_WORKSPACE/bulletin-tests-run-XXXXX)/test"
echo "TEST_DIR=$TEST_DIR" >> "$GITHUB_ENV"
echo "RUNTIME_PACKAGE=${RUNTIME_PACKAGE}" >> "$GITHUB_ENV"
just KUBO_VERSION="${KUBO_VERSION}" start-services "$TEST_DIR" "$RUNTIME_PACKAGE" "kubo-native"
- name: Test authorize-and-store ws
working-directory: examples
run: just run-test-authorize-and-store "$TEST_DIR" "$RUNTIME_PACKAGE" "ws"
- name: Test authorize-and-store smoldot
working-directory: examples
run: just run-test-authorize-and-store "$TEST_DIR" "$RUNTIME_PACKAGE" "smoldot"
- name: Test store-chunked-data
working-directory: examples
run: just run-test-store-chunked-data "$TEST_DIR"
- name: Test native-ipfs-dag-pb-chunked-data
working-directory: examples
run: just run-test-native-ipfs-dag-pb-chunked-data "$TEST_DIR"
- name: Test store-big-data
working-directory: examples
run: just run-test-store-big-data "$TEST_DIR" "big32"
- name: Test authorize-preimage-and-store
working-directory: examples
run: just run-test-authorize-preimage-and-store "$TEST_DIR"
- name: Test HOP round trip
working-directory: examples
run: just run-test-hop-round-trip "$TEST_DIR"
- name: Test chopsticks compatibility
working-directory: examples
run: just run-test-chopsticks "ws://127.0.0.1:10000"
# SDK Client Tests
- name: Test Rust SDK
working-directory: examples
run: just test-rust-sdk "${{ env.TEST_DIR }}" "$RUNTIME_PACKAGE"
- name: Test TypeScript SDK
working-directory: examples
run: just test-ts-sdk "${{ env.TEST_DIR }}"
- name: Test TypeScript SDK (vitest integration)
working-directory: examples
# TODO: https://github.com/paritytech/polkadot-bulletin-chain/issues/443
# Flaky chunked-store tests hit the per-tx timeout under CI load.
# Remove `continue-on-error` once the vitest integration suite is
# stabilized.
continue-on-error: true
run: just test-ts-sdk-vitest
- name: Run console-ui tests
working-directory: console-ui
run: just test
- name: Upload console-ui tests report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report-${{ matrix.runtime.name }}
path: console-ui/playwright-report/
retention-days: 14
- name: Stop services
if: always()
working-directory: examples
run: just KUBO_VERSION="${KUBO_VERSION}" stop-services "$TEST_DIR" "kubo-native"
- name: Upload Zombienet logs (on failure)
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: failed-zombienet-logs-${{ matrix.runtime.name }}
path: |
${{ env.TEST_DIR }}/*.log
integration-tests-complete:
name: All integration tests passed
needs: [changes, integration-tests]
if: always()
runs-on: ubuntu-latest
steps:
- name: Decide outcome
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "Integration tests failed or were cancelled"
exit 1