-
Notifications
You must be signed in to change notification settings - Fork 1.1k
242 lines (215 loc) · 9.78 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
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_accountRange,debug_getModifiedAccountsByHash,debug_getModifiedAccountsByNumber,debug_storageRangeAt,debug_traceBlockByHash,\
debug_traceCallMany/test_02.tar,debug_traceCallMany/test_04.tar,debug_traceCallMany/test_05.tar,debug_traceCallMany/test_06.tar,debug_traceCallMany/test_07.tar,debug_traceCallMany/test_09.json,debug_traceCallMany/test_10.tar,\
debug_traceBlockByNumber/test_05.tar,debug_traceBlockByNumber/test_08.tar,debug_traceBlockByNumber/test_09.tar,debug_traceBlockByNumber/test_10.tar,debug_traceBlockByNumber/test_11.tar,debug_traceBlockByNumber/test_12.tar,\
debug_traceTransaction,\
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_createAccessList/test_16.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_filter/test_16.json,\
trace_rawTransaction/test_01.json,\
trace_rawTransaction/test_03.json,\
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,\
txpool_content/test_01.json,\
txpool_status/test_1.json,\
web3_clientVersion/test_1.json,\
eth_estimateGas/test_14.json,\
trace_replayBlockTransactions/test_29.tar
# 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