Skip to content

Commit fa078f6

Browse files
mriccobenecanepat
andauthored
tests: pause/resume Erigon, save test results (#1921)
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
1 parent 86a166b commit fa078f6

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

.github/workflows/rpc-integration-tests.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
env:
1616
ERIGON_DATA_DIR: /opt/erigon/datadir
1717
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
18+
ERIGON_QA_PATH: /opt/erigon-qa
1819

1920
steps:
2021
- name: Checkout Silkworm Repository
@@ -45,6 +46,10 @@ jobs:
4546
working-directory: ${{runner.workspace}}/silkworm/build
4647
run: cmake --build . --config Release --target rpcdaemon -j 8
4748

49+
- name: Pause the Erigon instance dedicated to db maintenance
50+
run: |
51+
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
52+
4853
- name: Start Silkworm RpcDaemon
4954
working-directory: ${{runner.workspace}}/silkworm/build/cmd
5055
run: |
@@ -60,6 +65,7 @@ jobs:
6065
set +e # Disable exit on error
6166
6267
cd ${{runner.workspace}}/rpc-tests/integration
68+
rm -rf ./mainnet/results/
6369
6470
# Run RPC integration test runner via http
6571
python3 ./run_tests.py --continue --blockchain mainnet --jwt ${{runner.workspace}}/silkworm/build/cmd/jwt.hex --display-only-fail --port 8545 -x admin_,eth_mining,eth_getWork,eth_coinbase,eth_createAccessList/test_16.json,engine_ --transport_type http,websocket
@@ -77,7 +83,7 @@ jobs:
7783
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
7884
7985
# Save failed results to a directory with timestamp and commit hash
80-
mv ${{runner.workspace}}/rpc-tests/integration/mainnet/results $RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_integration_$(git rev-parse --short HEAD)_http
86+
cp -r ${{runner.workspace}}/rpc-tests/integration/mainnet/results/ $RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_integration_$(git -C ${{runner.workspace}}/silkworm rev-parse --short HEAD)_http/
8187
fi
8288
8389
- name: Stop Silkworm RpcDaemon
@@ -92,6 +98,24 @@ jobs:
9298
echo "Silkworm RpcDaemon has already terminated"
9399
fi
94100
101+
- name: Resume the Erigon instance dedicated to db maintenance
102+
run: |
103+
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true
104+
105+
- name: Upload test results
106+
if: steps.test_step.outputs.TEST_RESULT != 'success'
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: test-results
110+
path: ${{runner.workspace}}/rpc-tests/integration/mainnet/results/
111+
112+
- name: Save test results
113+
if: steps.test_step.outputs.TEST_RESULT != 'success'
114+
working-directory: ${{runner.workspace}}/silkworm
115+
env:
116+
TEST_RESULT: ${{ steps.test_step.outputs.TEST_RESULT }}
117+
run: python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --commit $(git rev-parse HEAD) --test_name rpc-integration-tests --outcome $TEST_RESULT #--result_file ${{runner.workspace}}/rpc-tests/integration/mainnet/result.json
118+
95119
- name: Action for Success
96120
if: steps.test_step.outputs.TEST_RESULT == 'success'
97121
run: echo "::notice::Tests completed successfully"

.github/workflows/rpc-performance-tests.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
env:
1111
ERIGON_DATA_DIR: /opt/erigon/datadir
1212
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
13+
ERIGON_QA_PATH: /opt/erigon-qa
1314

1415
steps:
1516
- name: Checkout Silkworm repository
@@ -40,19 +41,24 @@ jobs:
4041
working-directory: ${{runner.workspace}}/silkworm/build
4142
run: cmake --build . --config Release --target rpcdaemon -j 8
4243

44+
- name: Pause the Erigon instance dedicated to db maintenance
45+
run: |
46+
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
47+
4348
- name: Run Silkworm RpcDaemon
4449
working-directory: ${{runner.workspace}}/silkworm/build/cmd
4550
run: |
4651
./rpcdaemon --datadir $ERIGON_DATA_DIR --api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --log.verbosity 1 --erigon_compatibility --jwt ./jwt.hex --skip_protocol_check &
4752
RPC_DAEMON_PID=$!
4853
echo "RPC_DAEMON_PID=$RPC_DAEMON_PID" >> $GITHUB_ENV
4954
50-
- name: Run RPC Performances Tests
55+
- name: Run RPC Performance Tests
5156
id: test_step
5257
run: |
5358
set +e # Disable exit on error
5459
5560
cd ${{runner.workspace}}/rpc-tests/perf
61+
rm -rf ./reports/mainnet
5662
5763
# Launch the RPC performance test runner
5864
python3 ./run_perf_tests.py -b mainnet -y eth_call -p pattern/mainnet/stress_test_eth_call_001_14M.tar -t 1:1,100:30,1000:20,10000:20,20000:20 -r 20 -s ${{runner.workspace}}/silkworm -g $ERIGON_DATA_DIR -m 2 -u
@@ -66,8 +72,8 @@ jobs:
6672
# Capture test runner script exit status
6773
perf_exit_status=$?
6874
69-
# Save test results to a directory with timestamp and commit hash
70-
mv ${{runner.workspace}}/rpc-tests/perf/reports/mainnet $RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_perf_$(git rev-parse --short HEAD)
75+
# Save test results to a directory with timestamp and commit hash
76+
cp -r ${{runner.workspace}}/rpc-tests/perf/reports/mainnet $RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_perf_$(git -C ${{runner.workspace}}/silkworm rev-parse --short HEAD)
7177
7278
# Check test runner script exit status
7379
if [ $perf_exit_status -eq 0 ]; then
@@ -89,6 +95,24 @@ jobs:
8995
echo "rpc-daemon has already terminated"
9096
fi
9197
98+
- name: Resume the Erigon instance dedicated to db maintenance
99+
run: |
100+
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true
101+
102+
- name: Upload test results
103+
if: always()
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: test-results
107+
path: ${{runner.workspace}}/rpc-tests/perf/reports/mainnet
108+
109+
- name: Save test results
110+
if: always()
111+
working-directory: ${{runner.workspace}}/silkworm
112+
env:
113+
TEST_RESULT: ${{ steps.test_step.outputs.TEST_RESULT }}
114+
run: python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --commit $(git rev-parse HEAD) --test_name rpc-performance-tests --outcome $TEST_RESULT #--result_file ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/result.json
115+
92116
- name: Action for Success
93117
if: steps.test_step.outputs.TEST_RESULT == 'success'
94118
run: echo "::notice::Tests completed successfully"

0 commit comments

Comments
 (0)