forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 42
333 lines (306 loc) · 13.5 KB
/
qa-rpc-integration-tests.yml
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
name: QA - RPC Integration Tests
on:
workflow_dispatch: # Run manually
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
# types:
# - opened
# - reopened
# - synchronize
# - ready_for_review
jobs:
integration-test-suite:
runs-on: [self-hosted, Erigon3]
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version/datadir
ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
ERIGON_QA_PATH: /home/qarunner/erigon-qa
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
CHAIN: mainnet
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Checkout RPC Tests Repository & Install Requirements
run: |
rm -rf ${{ runner.workspace }}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.0.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{ runner.workspace }}/rpc-tests
pip3 install -r requirements.txt
- name: Clean Erigon Build Directory
run: |
make clean
- name: Build Erigon RPCDaemon
run: |
make rpcdaemon
working-directory: ${{ github.workspace }}
- name: Pause the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
- name: Run RpcDaemon
working-directory: ${{ github.workspace }}/build/bin
run: |
echo "RpcDaemon starting..."
./rpcdaemon --datadir $ERIGON_REFERENCE_DATA_DIR --http.api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --ws --verbosity 1 > erigon.log 2>&1 &
RPC_DAEMON_PID=$!
echo "RPC_DAEMON_PID=$RPC_DAEMON_PID" >> $GITHUB_ENV
echo "RpcDaemon started"
- name: Wait for port 8545 to be opened
run: |
for i in {1..30}; do
if nc -z localhost 8545; then
echo "Port 8545 is open"
break
fi
echo "Waiting for port 8545 to open..."
sleep 10
done
if ! nc -z localhost 8545; then
echo "Port 8545 did not open in time"
exit 1
fi
- name: Run RPC Integration Tests
id: test_step
run: |
set +e # Disable exit on error
commit=$(git -C ${{runner.workspace}}/erigon rev-parse --short HEAD)
cd ${{ runner.workspace }}/rpc-tests/integration
rm -rf ./mainnet/results/
# Run RPC integration test runner via http
python3 ./run_tests.py -p 8545 --continue -f --json-diff -x debug_,\
engine_exchangeCapabilities/test_1.json,\
engine_exchangeTransitionConfigurationV1/test_01.json,\
engine_getClientVersionV1/test_1.json,\
erigon_getLogsByHash/test_04.json,\
erigon_getHeaderByHash/test_02.json,\
erigon_getHeaderByHash/test_03.json,\
erigon_getHeaderByHash/test_04.json,\
erigon_getHeaderByHash/test_06.json,\
erigon_getHeaderByNumber/test_01.json,\
erigon_getHeaderByNumber/test_02.json,\
erigon_getHeaderByNumber/test_03.json,\
erigon_getHeaderByNumber/test_04.json,\
erigon_getHeaderByNumber/test_05.json,\
erigon_getHeaderByNumber/test_06.json,\
erigon_getHeaderByNumber/test_07.json,\
erigon_getHeaderByNumber/test_08.json,\
erigon_getLatestLogs/test_01.json,\
erigon_getLatestLogs/test_02.json,\
erigon_getLatestLogs/test_03.json,\
erigon_getLatestLogs/test_04.json,\
erigon_getLatestLogs/test_05.json,\
erigon_getLatestLogs/test_06.json,\
erigon_getLatestLogs/test_08.json,\
erigon_getLatestLogs/test_09.json,\
erigon_getLatestLogs/test_10.json,\
erigon_getLatestLogs/test_11.json,\
erigon_getLatestLogs/test_12.json,\
erigon_getBalanceChangesInBlock,\
eth_callBundle/test_09.json,\
eth_callBundle/test_12.json,\
eth_createAccessList/test_06.json,\
eth_createAccessList/test_07.json,\
eth_createAccessList/test_15.json,\
eth_createAccessList/test_16.json,\
eth_getBlockTransactionCountByHash/test_02.json,\
eth_getBlockTransactionCountByNumber/test_08.json,\
eth_getUncleCountByBlockHash/test_03.json,\
parity_getBlockReceipts/test_01.json,\
parity_getBlockReceipts/test_02.json,\
parity_getBlockReceipts/test_03.json,\
parity_getBlockReceipts/test_04.json,\
parity_getBlockReceipts/test_05.json,\
parity_getBlockReceipts/test_06.json,\
parity_getBlockReceipts/test_07.json,\
parity_getBlockReceipts/test_08.json,\
parity_getBlockReceipts/test_09.json,\
parity_getBlockReceipts/test_10.json,\
trace_call/test_02.json,\
trace_call/test_04.tar,\
trace_call/test_08.tar,\
trace_call/test_11.tar,\
trace_call/test_13.json,\
trace_call/test_17.tar,\
trace_call/test_19.tar,\
trace_call/test_20.json,\
trace_callMany/test_01.json,\
trace_callMany/test_02.json,\
trace_callMany/test_03.json,\
trace_callMany/test_04.json,\
trace_callMany/test_05.json,\
trace_callMany/test_06.json,\
trace_callMany/test_07.json,\
trace_callMany/test_08.json,\
trace_callMany/test_09.json,\
trace_callMany/test_10.json,\
trace_callMany/test_11.json,\
trace_callMany/test_12.json,\
trace_filter/test_16.json,\
trace_rawTransaction/test_01.json,\
trace_rawTransaction/test_03.json,\
trace_replayBlockTransactions/test_01.tar,\
trace_replayBlockTransactions/test_02.tar,\
trace_replayBlockTransactions/test_03.tar,\
trace_replayBlockTransactions/test_04.tar,\
trace_replayBlockTransactions/test_05.tar,\
trace_replayBlockTransactions/test_08.tar,\
trace_replayBlockTransactions/test_10.json,\
trace_replayBlockTransactions/test_11.json,\
trace_replayBlockTransactions/test_13.tar,\
trace_replayBlockTransactions/test_14.tar,\
trace_replayBlockTransactions/test_15.tar,\
trace_replayBlockTransactions/test_16.tar,\
trace_replayBlockTransactions/test_17.tar,\
trace_replayBlockTransactions/test_18.tar,\
trace_replayBlockTransactions/test_19.tar,\
trace_replayBlockTransactions/test_20.tar,\
trace_replayBlockTransactions/test_21.tar,\
trace_replayBlockTransactions/test_22.tar,\
trace_replayBlockTransactions/test_23.tar,\
trace_replayBlockTransactions/test_24.tar,\
trace_replayBlockTransactions/test_25.tar,\
trace_replayTransaction/test_02.tar,\
trace_replayTransaction/test_03.tar,\
trace_replayTransaction/test_04.tar,\
trace_replayTransaction/test_05.tar,\
trace_replayTransaction/test_06.tar,\
trace_replayTransaction/test_07.tar,\
trace_replayTransaction/test_10.tar,\
trace_replayTransaction/test_11.tar,\
trace_replayTransaction/test_14.tar,\
trace_replayTransaction/test_16.tar,\
trace_replayTransaction/test_18.tar,\
trace_replayTransaction/test_23.tar,\
trace_replayTransaction/test_24.json,\
trace_replayTransaction/test_29.tar,\
admin_nodeInfo/test_01.json,\
admin_peers/test_01.json,\
erigon_nodeInfo/test_1.json,\
eth_coinbase/test_01.json,\
eth_feeHistory/test_01.json,\
eth_feeHistory/test_02.json,\
eth_feeHistory/test_03.json,\
eth_feeHistory/test_04.json,\
eth_feeHistory/test_05.json,\
eth_feeHistory/test_06.json,\
eth_feeHistory/test_08.json,\
eth_feeHistory/test_09.json,\
eth_feeHistory/test_10.json,\
eth_feeHistory/test_11.json,\
eth_getBlockByHash/test_01.json,\
eth_getBlockByHash/test_02.json,\
eth_getBlockByHash/test_05.json,\
eth_getBlockByHash/test_06.json,\
eth_getBlockByHash/test_07.json,\
eth_getBlockByHash/test_08.json,\
eth_getBlockByNumber/test_01.json,\
eth_getBlockByNumber/test_02.json,\
eth_getBlockByNumber/test_04.json,\
eth_getBlockByNumber/test_05.json,\
eth_getBlockByNumber/test_06.json,\
eth_getBlockByNumber/test_07.json,\
eth_getBlockByNumber/test_08.json,\
eth_getBlockByNumber/test_12.json,\
eth_getBlockByNumber/test_13.json,\
eth_getTransactionByHash/test_02.json,\
eth_getWork/test_01.json,\
eth_mining/test_01.json,\
eth_protocolVersion/test_1.json,\
eth_submitHashrate/test_1.json,\
eth_submitWork/test_1.json,\
net_peerCount/test_1.json,\
net_version/test_1.json,\
ots_getBlockDetails/test_01.json,\
ots_getBlockDetails/test_02.json,\
ots_getBlockDetails/test_03.json,\
ots_getBlockDetails/test_04.json,\
ots_getBlockDetails/test_05.json,\
ots_getBlockDetailsByHash/test_01.json,\
ots_getBlockDetailsByHash/test_02.json,\
ots_getBlockDetailsByHash/test_03.json,\
ots_getBlockDetailsByHash/test_04.json,\
ots_getBlockTransactions/test_01.json,\
ots_getBlockTransactions/test_02.json,\
ots_getBlockTransactions/test_03.json,\
ots_getBlockTransactions/test_04.json,\
ots_getBlockTransactions/test_05.json,\
ots_searchTransactionsBefore/test_13.json,\
trace_call/test_05.json,\
trace_call/test_07.json,\
trace_call/test_12.json,\
trace_call/test_14.json,\
trace_call/test_15.json,\
trace_call/test_16.json,\
trace_call/test_18.json,\
txpool_content/test_01.json,\
txpool_status/test_1.json,\
web3_clientVersion/test_1.json,\
eth_estimateGas/test_14.json,\
trace_replayBlockTransactions/test_26.tar,\
trace_replayBlockTransactions/test_28.tar,\
trace_replayBlockTransactions/test_29.tar,\
trace_replayBlockTransactions/test_31.tar,\
trace_replayBlockTransactions/test_32.tar,\
trace_replayBlockTransactions/test_33.tar,\
trace_replayBlockTransactions/test_34.tar,\
trace_replayBlockTransactions/test_35.tar,\
trace_replayTransaction/test_31.json,\
trace_replayTransaction/test_32.json,\
trace_replayTransaction/test_34.json
# Capture test runner script exit status
test_exit_status=$?
# Save the subsection reached status
echo "::set-output name=test_executed::true"
# Check test runner exit status
if [ $test_exit_status -eq 0 ]; then
echo "tests completed successfully"
echo
echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
else
echo "error detected during tests"
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
# Save failed results to a directory with timestamp and commit hash
cp -r ${{ runner.workspace }}/rpc-tests/integration/mainnet/results/ $RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_integration_$commit_http/
fi
- name: Stop Erigon RpcDaemon
working-directory: ${{ github.workspace }}/build/bin
run: |
# Clean up rpcdaemon process if it's still running
if kill -0 $RPC_DAEMON_PID 2> /dev/null; then
echo "RpcDaemon stopping..."
kill $RPC_DAEMON_PID
echo "RpcDaemon stopped"
else
echo "RpcDaemon has already terminated"
fi
- name: Resume the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true
- name: Upload test results
if: steps.test_step.outputs.test_executed == 'true'
uses: actions/upload-artifact@v4
with:
name: test-results
path: ${{ runner.workspace }}/rpc-tests/integration/mainnet/results/
- name: Save test results
if: steps.test_step.outputs.test_executed == 'true'
working-directory: ${{ github.workspace }}
env:
TEST_RESULT: ${{ steps.test_step.outputs.TEST_RESULT }}
run: |
db_version=$(python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/prod_info.py $ERIGON_REFERENCE_DATA_DIR/../production.ini production erigon_repo_commit)
if [ -z "$db_version" ]; then
db_version="no-version"
fi
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo erigon --commit $(git rev-parse HEAD) --branch ${{ github.ref_name }} --test_name rpc-integration-tests --chain $CHAIN --runner ${{ runner.name }} --db_version $db_version --outcome $TEST_RESULT #--result_file ${{ github.workspace }}/result-$CHAIN.json
- name: Action for Success
if: steps.test_step.outputs.TEST_RESULT == 'success'
run: echo "::notice::Tests completed successfully"
- name: Action for Failure
if: steps.test_step.outputs.TEST_RESULT != 'success'
run: |
echo "::error::Error detected during tests"
exit 1