Skip to content

Commit 2cbc70d

Browse files
authored
qa-tests: run rpc-integration tests on other clients (#20201)
1 parent 555dcaf commit 2cbc70d

3 files changed

Lines changed: 218 additions & 0 deletions

File tree

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: QA - RPC Integration Tests (Other Clients)
2+
3+
on:
4+
schedule:
5+
- cron: '0 5 * * *' # Run daily at 05:00 UTC
6+
workflow_dispatch: # Run manually
7+
8+
concurrency:
9+
group: rpc-clients-integration-${{ github.run_id }}
10+
cancel-in-progress: false
11+
12+
jobs:
13+
client-rpc-integ-tests:
14+
name: RPC Integration Tests - ${{ matrix.client }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- client: geth
20+
runs-on: [ self-hosted, qa, Ethereum, rpc-integration-geth ]
21+
test_script: run_rpc_tests_geth.sh
22+
install_dir: /opt/go-ethereum
23+
- client: nethermind
24+
runs-on: [ self-hosted, qa, Ethereum, rpc-integration-nethermind ]
25+
test_script: run_rpc_tests_nethermind.sh
26+
install_dir: /opt/nethermind
27+
runs-on: ${{ matrix.runs-on }}
28+
env:
29+
ERIGON_QA_PATH: /home/qarunner/erigon-qa
30+
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
31+
CHAIN: mainnet
32+
33+
steps:
34+
- name: Check out repository
35+
uses: actions/checkout@v6
36+
37+
- name: Wait for port 8545 to be available
38+
run: |
39+
for i in {1..30}; do
40+
if nc -z localhost 8545; then
41+
echo "Port 8545 is open"
42+
break
43+
fi
44+
echo "Waiting for port 8545 to open..."
45+
sleep 10
46+
done
47+
if ! nc -z localhost 8545; then
48+
echo "::error::Port 8545 did not open in time - ${{ matrix.client }} may not be running"
49+
exit 1
50+
fi
51+
52+
- name: Restore rpc-tests cache
53+
uses: actions/cache@v4
54+
with:
55+
path: ${{ runner.workspace }}/rpc-tests
56+
key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-v2.2.0
57+
58+
- name: Run RPC Integration Tests
59+
id: test_step
60+
run: |
61+
client_version=$(git -C ${{ matrix.install_dir }} rev-parse --short HEAD 2>/dev/null || echo "no-version")
62+
TEST_RESULT_DIR="$RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_integration_${{ matrix.client }}_${client_version}_http"
63+
echo "TEST_RESULT_DIR=$TEST_RESULT_DIR" >> $GITHUB_ENV
64+
65+
set +e # Disable exit on error for test run
66+
${{ github.workspace }}/.github/workflows/scripts/${{ matrix.test_script }} \
67+
"${{ runner.workspace }}" \
68+
"$TEST_RESULT_DIR"
69+
test_exit_status=$?
70+
set -e # Re-enable exit on error after test run
71+
72+
echo "test_executed=true" >> $GITHUB_OUTPUT
73+
74+
echo
75+
if [ $test_exit_status -eq 0 ]; then
76+
echo "RPC tests completed successfully"
77+
echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
78+
else
79+
echo "::error::Error detected during RPC tests: some tests failed, check the logs or the artifacts for more details"
80+
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
81+
exit 1
82+
fi
83+
84+
- name: Generate Summary
85+
if: always() && steps.test_step.outputs.test_executed == 'true'
86+
run: |
87+
SUMMARY_FILE="${{ env.TEST_RESULT_DIR }}/summary.md"
88+
LOG_FILE="${{ env.TEST_RESULT_DIR }}/output.log"
89+
90+
cat << 'EOF' > $SUMMARY_FILE
91+
# ${{ github.workflow }} - ${{ matrix.client }} Report
92+
93+
## Test Configuration
94+
- **Client:** ${{ matrix.client }}
95+
- **Chain:** ${{ env.CHAIN }}
96+
- **Result:** ${{ steps.test_step.outputs.TEST_RESULT }}
97+
98+
## Test Output
99+
```
100+
EOF
101+
102+
cat $LOG_FILE >> $SUMMARY_FILE
103+
104+
echo '```' >> $SUMMARY_FILE
105+
106+
cat $SUMMARY_FILE
107+
cat $SUMMARY_FILE >> $GITHUB_STEP_SUMMARY
108+
109+
- name: Upload test results
110+
if: always() && steps.test_step.outputs.test_executed == 'true'
111+
uses: actions/upload-artifact@v6
112+
with:
113+
name: test-results-${{ matrix.client }}
114+
path: ${{ env.TEST_RESULT_DIR }}
115+
116+
- name: Save test results
117+
if: always() && steps.test_step.outputs.test_executed == 'true'
118+
env:
119+
TEST_RESULT: ${{ steps.test_step.outputs.TEST_RESULT }}
120+
run: |
121+
client_version=$(git -C ${{ matrix.install_dir }} rev-parse HEAD 2>/dev/null || echo "no-version")
122+
123+
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py \
124+
--repo ${{ matrix.client }} \
125+
--commit $client_version \
126+
--branch release \
127+
--test_name rpc-integration-tests \
128+
--chain $CHAIN \
129+
--runner ${{ runner.name }} \
130+
--db_version no-version \
131+
--outcome $TEST_RESULT \
132+
--result_file $TEST_RESULT_DIR/results/test_report.json
133+
134+
- name: Action to check failure condition
135+
if: failure()
136+
run: |
137+
if [ "${{ steps.test_step.outputs.test_executed }}" != "true" ]; then
138+
echo "::error::Test not executed, workflow failed for infrastructure reasons"
139+
fi
140+
exit 1
141+
142+
- name: Action for Success
143+
if: steps.test_step.outputs.TEST_RESULT == 'success'
144+
run: echo "::notice::Tests completed successfully for ${{ matrix.client }}"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -e # Enable exit on error
3+
4+
# The workspace directory, no default because run_rpc_tests has it
5+
WORKSPACE="$1"
6+
# The result directory, no default because run_rpc_tests has it
7+
RESULT_DIR="$2"
8+
9+
# Disabled tests for Geth on Ethereum mainnet
10+
DISABLED_TEST_LIST=(
11+
# Erigon-specific namespace - not supported by Geth
12+
erigon_
13+
# Otterscan-specific namespace - not supported by Geth
14+
ots_
15+
# OpenEthereum/Parity-specific namespace - not supported by Geth
16+
parity_
17+
# OpenEthereum-style trace API - not supported by Geth
18+
trace_
19+
# Engine API runs on authenticated port 8551, not 8545
20+
engine_
21+
# Admin info format differs between clients
22+
admin_nodeInfo/test_01.json
23+
admin_peers/test_01.json
24+
# Mining/PoW endpoints not applicable on PoS mainnet
25+
eth_coinbase/test_01.json
26+
eth_getWork/test_01.json
27+
eth_mining/test_01.json
28+
eth_submitHashrate/test_1.json
29+
eth_submitWork/test_1.json
30+
# Temporary disable required block 24298763
31+
debug_traceBlockByNumber/test_51.json
32+
)
33+
34+
# Transform the array into a comma-separated string
35+
DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}")
36+
37+
# Call the main test runner script with the required and optional parameters
38+
# Use do-not-compare-error-message since Geth error messages differ from Erigon
39+
"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.2.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "" "" "do-not-compare-error-message"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
set -e # Enable exit on error
3+
4+
# The workspace directory, no default because run_rpc_tests has it
5+
WORKSPACE="$1"
6+
# The result directory, no default because run_rpc_tests has it
7+
RESULT_DIR="$2"
8+
9+
# Disabled tests for Nethermind on Ethereum mainnet
10+
DISABLED_TEST_LIST=(
11+
# Erigon-specific namespace - not supported by Nethermind
12+
erigon_
13+
# Otterscan-specific namespace - not supported by Nethermind
14+
ots_
15+
# Engine API runs on authenticated port 8551, not 8545
16+
engine_
17+
# Admin info format differs between clients
18+
admin_nodeInfo/test_01.json
19+
admin_peers/test_01.json
20+
# Mining/PoW endpoints not applicable on PoS mainnet
21+
eth_coinbase/test_01.json
22+
eth_getWork/test_01.json
23+
eth_mining/test_01.json
24+
eth_submitHashrate/test_1.json
25+
eth_submitWork/test_1.json
26+
# Temporary disable required block 24298763
27+
debug_traceBlockByNumber/test_51.json
28+
)
29+
30+
# Transform the array into a comma-separated string
31+
DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}")
32+
33+
# Call the main test runner script with the required and optional parameters
34+
# Use do-not-compare-error-message since Nethermind error messages differ from Erigon
35+
"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.2.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "" "" "do-not-compare-error-message"

0 commit comments

Comments
 (0)