Skip to content

QA - RPC Integration Tests #5

QA - RPC Integration Tests

QA - RPC Integration Tests #5

name: QA - RPC Integration Tests
on:
schedule:
- cron: '0 8 * * *' # Run every day at 8:00 UTC
workflow_dispatch: # Run manually
push:
branches:
- qa_tests_rpc_integration_v3 # only to debug the workflow
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 v0.42.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 erigon
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: Restore Erigon Testbed Data Directory
run: |
rsync -a --delete $ERIGON_REFERENCE_DATA_DIR/ $ERIGON_TESTBED_DATA_DIR/
- name: Run RpcDaemon
working-directory: ${{ github.workspace }}/build/bin
run: |
echo "Erigon (RpcDaemon) starting..."
./erigon --datadir $ERIGON_TESTBED_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 "Erigon (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 -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,\
ots_getTransactionBySenderAndNonce/test_05.json,\
ots_getTransactionBySenderAndNonce/test_11.json,\
ots_searchTransactionsAfter/test_01.json,\
ots_searchTransactionsAfter/test_03.json,\
ots_searchTransactionsAfter/test_04.json,\
ots_searchTransactionsAfter/test_06.json,\
ots_searchTransactionsAfter/test_08.json,\
ots_searchTransactionsAfter/test_09.json,\
ots_searchTransactionsAfter/test_10.json,\
ots_searchTransactionsAfter/test_11.json,\
ots_searchTransactionsAfter/test_12.json,\
ots_searchTransactionsAfter/test_13.json,\
ots_searchTransactionsBefore/test_01.json,\
ots_searchTransactionsBefore/test_03.json,\
ots_searchTransactionsBefore/test_04.json,\
ots_searchTransactionsBefore/test_06.json,\
ots_searchTransactionsBefore/test_09.json,\
ots_searchTransactionsBefore/test_10.json,\
ots_searchTransactionsBefore/test_11.json,\
ots_searchTransactionsBefore/test_12.json,\
ots_searchTransactionsBefore/test_13.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 "Erigon RpcDaemon stopping..."
kill $RPC_DAEMON_PID
echo "Erigon RpcDaemon stopped"
else
echo "Erigon RpcDaemon has already terminated"
fi
- name: Delete Erigon Testbed Data Directory
if: always()
run: |
rm -rf $ERIGON_TESTBED_DATA_DIR
- 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