mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
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.
This commit is contained in:
43
.github/workflows/local-testnet.yml
vendored
43
.github/workflows/local-testnet.yml
vendored
@@ -52,20 +52,18 @@ jobs:
|
|||||||
- name: Load Docker image
|
- name: Load Docker image
|
||||||
run: docker load -i lighthouse-docker.tar
|
run: docker load -i lighthouse-docker.tar
|
||||||
|
|
||||||
- name: Start local testnet
|
- name: Start local testnet with Assertoor
|
||||||
run: ./start_local_testnet.sh -e local -c -b false && sleep 60
|
run: ./start_local_testnet.sh -e local-assertoor -c -a -b false && sleep 60
|
||||||
working-directory: scripts/local_testnet
|
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
|
- name: Stop local testnet and dump logs
|
||||||
run: ./stop_local_testnet.sh local
|
run: ./stop_local_testnet.sh local-assertoor
|
||||||
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
|
|
||||||
working-directory: scripts/local_testnet
|
working-directory: scripts/local_testnet
|
||||||
|
|
||||||
- name: Upload logs artifact
|
- name: Upload logs artifact
|
||||||
@@ -76,6 +74,29 @@ jobs:
|
|||||||
scripts/local_testnet/logs
|
scripts/local_testnet/logs
|
||||||
retention-days: 3
|
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:
|
doppelganger-protection-success-test:
|
||||||
needs: dockerfile-ubuntu
|
needs: dockerfile-ubuntu
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ BUILD_IMAGE=true
|
|||||||
BUILDER_PROPOSALS=false
|
BUILDER_PROPOSALS=false
|
||||||
CI=false
|
CI=false
|
||||||
KEEP_ENCLAVE=false
|
KEEP_ENCLAVE=false
|
||||||
|
RUN_ASSERTOOR_TESTS=false
|
||||||
|
|
||||||
# Get options
|
# Get options
|
||||||
while getopts "e:b:n:phck" flag; do
|
while getopts "e:b:n:phcak" flag; do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
|
a) RUN_ASSERTOOR_TESTS=true;;
|
||||||
e) ENCLAVE_NAME=${OPTARG};;
|
e) ENCLAVE_NAME=${OPTARG};;
|
||||||
b) BUILD_IMAGE=${OPTARG};;
|
b) BUILD_IMAGE=${OPTARG};;
|
||||||
n) NETWORK_PARAMS_FILE=${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 " -n: kurtosis network params file path default: $NETWORK_PARAMS_FILE"
|
||||||
echo " -p: enable builder proposals"
|
echo " -p: enable builder proposals"
|
||||||
echo " -c: CI mode, run without other additional services like Grafana and Dora explorer"
|
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 " -k: keeping enclave to allow starting the testnet without destroying the existing one"
|
||||||
echo " -h: this help"
|
echo " -h: this help"
|
||||||
exit
|
exit
|
||||||
@@ -63,11 +66,18 @@ if [ "$BUILDER_PROPOSALS" = true ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CI" = true ]; then
|
if [ "$CI" = true ]; then
|
||||||
# TODO: run assertoor tests
|
|
||||||
yq eval '.additional_services = []' -i $NETWORK_PARAMS_FILE
|
yq eval '.additional_services = []' -i $NETWORK_PARAMS_FILE
|
||||||
echo "Running without additional services (CI mode)."
|
echo "Running without additional services (CI mode)."
|
||||||
fi
|
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
|
if [ "$BUILD_IMAGE" = true ]; then
|
||||||
echo "Building Lighthouse Docker image."
|
echo "Building Lighthouse Docker image."
|
||||||
ROOT_DIR="$SCRIPT_DIR/../.."
|
ROOT_DIR="$SCRIPT_DIR/../.."
|
||||||
|
|||||||
Reference in New Issue
Block a user