|
| 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 }}" |
0 commit comments