From 886ceb7e25e06cf4a4809508a83ee342b75f1ba4 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Mon, 2 Jun 2025 09:47:06 +0900 Subject: [PATCH] Run Assertoor tests in CI (#6882) Added Assertoor tests to the local-testnet CI. - The assertoor logs are included in the `logs-local-testnet` that is uploaded to GitHub Artifacts. - Use `start_local_testnet.sh` so that we can also easily run the test locally. --- .github/workflows/local-testnet.yml | 43 +++++++++++++++----- scripts/local_testnet/start_local_testnet.sh | 14 ++++++- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/.github/workflows/local-testnet.yml b/.github/workflows/local-testnet.yml index 1cd2f24548..455931aa1e 100644 --- a/.github/workflows/local-testnet.yml +++ b/.github/workflows/local-testnet.yml @@ -52,20 +52,18 @@ jobs: - name: Load Docker image run: docker load -i lighthouse-docker.tar - - name: Start local testnet - run: ./start_local_testnet.sh -e local -c -b false && sleep 60 + - name: Start local testnet with Assertoor + run: ./start_local_testnet.sh -e local-assertoor -c -a -b false && sleep 60 working-directory: scripts/local_testnet + - name: Await Assertoor test result + id: assertoor_test_result + uses: ethpandaops/assertoor-github-action@v1 + with: + kurtosis_enclave_name: local-assertoor + - name: Stop local testnet and dump logs - run: ./stop_local_testnet.sh local - working-directory: scripts/local_testnet - - - name: Start local testnet with blinded block production - run: ./start_local_testnet.sh -e local-blinded -c -p -b false && sleep 60 - working-directory: scripts/local_testnet - - - name: Stop local testnet and dump logs - run: ./stop_local_testnet.sh local-blinded + run: ./stop_local_testnet.sh local-assertoor working-directory: scripts/local_testnet - name: Upload logs artifact @@ -76,6 +74,29 @@ jobs: scripts/local_testnet/logs retention-days: 3 + - name: Return Assertoor test result + shell: bash + run: | + test_result="${{ steps.assertoor_test_result.outputs.result }}" + test_status=$( + cat <<"EOF" + ${{ steps.assertoor_test_result.outputs.test_overview }} + EOF + ) + failed_test_status=$( + cat <<"EOF" + ${{ steps.assertoor_test_result.outputs.failed_test_details }} + EOF + ) + + echo "Test Result: $test_result" + echo "$test_status" + if ! [ "$test_result" == "success" ]; then + echo "Failed Test Task Status:" + echo "$failed_test_status" + exit 1 + fi + doppelganger-protection-success-test: needs: dockerfile-ubuntu runs-on: ubuntu-22.04 diff --git a/scripts/local_testnet/start_local_testnet.sh b/scripts/local_testnet/start_local_testnet.sh index 1f15688693..8e8859ca0e 100755 --- a/scripts/local_testnet/start_local_testnet.sh +++ b/scripts/local_testnet/start_local_testnet.sh @@ -13,10 +13,12 @@ BUILD_IMAGE=true BUILDER_PROPOSALS=false CI=false KEEP_ENCLAVE=false +RUN_ASSERTOOR_TESTS=false # Get options -while getopts "e:b:n:phck" flag; do +while getopts "e:b:n:phcak" flag; do case "${flag}" in + a) RUN_ASSERTOOR_TESTS=true;; e) ENCLAVE_NAME=${OPTARG};; b) BUILD_IMAGE=${OPTARG};; n) NETWORK_PARAMS_FILE=${OPTARG};; @@ -34,6 +36,7 @@ while getopts "e:b:n:phck" flag; do echo " -n: kurtosis network params file path default: $NETWORK_PARAMS_FILE" echo " -p: enable builder proposals" echo " -c: CI mode, run without other additional services like Grafana and Dora explorer" + echo " -a: run Assertoor tests" echo " -k: keeping enclave to allow starting the testnet without destroying the existing one" echo " -h: this help" exit @@ -63,11 +66,18 @@ if [ "$BUILDER_PROPOSALS" = true ]; then fi if [ "$CI" = true ]; then - # TODO: run assertoor tests yq eval '.additional_services = []' -i $NETWORK_PARAMS_FILE echo "Running without additional services (CI mode)." fi +if [ "$RUN_ASSERTOOR_TESTS" = true ]; then + yq eval '.additional_services += ["assertoor"] | .additional_services |= unique' -i $NETWORK_PARAMS_FILE + # The available tests can be found in the `assertoor_params` section: + # https://github.com/ethpandaops/ethereum-package?tab=readme-ov-file#configuration + yq eval '.assertoor_params = {"run_stability_check": true, "run_block_proposal_check": true, "run_transaction_test": true, "run_blob_transaction_test": true}' -i $NETWORK_PARAMS_FILE + echo "Assertoor has been added to $NETWORK_PARAMS_FILE." +fi + if [ "$BUILD_IMAGE" = true ]; then echo "Building Lighthouse Docker image." ROOT_DIR="$SCRIPT_DIR/../.."