From 2b77e0bf71fe6240bcf2ffdee9c5f551a2b904af Mon Sep 17 00:00:00 2001 From: Grant Zukel <80433392+gzukel@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:57:27 -0600 Subject: [PATCH] fix: update advanced testing pipeline to not execute tests that weren't selected so they show skipped instead of skipping steps. (#1945) * fix:update advanced testing pipeline to not execute tests that weren't selected so they show skipped instead of skipping steps. * change upgrade test height to 225 Co-authored-by: lumtis --- .github/workflows/execute_advanced_tests.yaml | 120 ++++++++++++++++-- changelog.md | 1 + .../localnet/orchestrator/start-zetae2e.sh | 4 +- contrib/localnet/scripts/start-zetacored.sh | 4 +- 4 files changed, 117 insertions(+), 12 deletions(-) diff --git a/.github/workflows/execute_advanced_tests.yaml b/.github/workflows/execute_advanced_tests.yaml index ef0c777df3..24b93481d9 100644 --- a/.github/workflows/execute_advanced_tests.yaml +++ b/.github/workflows/execute_advanced_tests.yaml @@ -19,60 +19,164 @@ on: type: boolean required: false default: false + debug: + type: boolean + required: false + default: false jobs: e2e-admin-tests: + if: ${{ github.event.inputs.e2e-admin-tests == 'true' }} runs-on: buildjet-4vcpu-ubuntu-2204 timeout-minutes: 120 steps: - name: "Checkout Code" - if: ${{ github.event.inputs.e2e-admin-tests == 'true' }} uses: actions/checkout@v3 - name: Execute e2e-admin-tests - if: ${{ github.event.inputs.e2e-admin-tests == 'true' }} shell: bash run: | make start-e2e-admin-test + container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}") + if [ -z "$container_id" ]; then + echo "Orchestrator container is not currently running. Exiting..." + exit 1 + fi + echo "Monitoring Orchestrator container with ID: $container_id" + while true; do + current_status=$(docker ps -q | grep $container_id || echo "docker-ps-error") + if [ "$current_status" == "docker-ps-error" ]; then + echo "***********************************" + echo "* *" + echo "* *" + echo "* TESTING COMPLETE *" + echo "* *" + echo "* *" + echo "***********************************" + docker logs $container_id || echo "no logs" + exit 0 + else + echo "Testing in progress still...." + if [ "${{ github.event.inputs.e2e-upgrade-test }}" == "true" ]; then + docker logs $container_id || echo "no logs" + fi + fi + sleep 5 + done e2e-upgrade-test: + if: ${{ github.event.inputs.e2e-upgrade-test == 'true' }} runs-on: buildjet-4vcpu-ubuntu-2204 timeout-minutes: 120 steps: - name: "Checkout Code" - if: ${{ github.event.inputs.e2e-upgrade-test == 'true' }} uses: actions/checkout@v3 - name: Execute upgrade-test - if: ${{ github.event.inputs.e2e-upgrade-test == 'true' }} shell: bash run: | make start-upgrade-test + container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}") + if [ -z "$container_id" ]; then + echo "Orchestrator container is not currently running. Exiting..." + exit 1 + fi + echo "Monitoring Orchestrator container with ID: $container_id" + while true; do + current_status=$(docker ps -q | grep $container_id || echo "docker-ps-error") + if [ "$current_status" == "docker-ps-error" ]; then + echo "***********************************" + echo "* *" + echo "* *" + echo "* TESTING COMPLETE *" + echo "* *" + echo "* *" + echo "***********************************" + docker logs $container_id || echo "no logs" + exit 0 + else + echo "Testing in progress still...." + if [ "${{ github.event.inputs.e2e-upgrade-test }}" == "true" ]; then + docker logs $container_id || echo "no logs" + fi + fi + sleep 5 + done e2e-upgrade-test-light: + if: ${{ github.event.inputs.e2e-upgrade-test-light == 'true' }} runs-on: buildjet-4vcpu-ubuntu-2204 timeout-minutes: 120 steps: - name: "Checkout Code" - if: ${{ github.event.inputs.e2e-upgrade-test-light == 'true' }} uses: actions/checkout@v3 - name: Execute upgrade-test-light - if: ${{ github.event.inputs.e2e-upgrade-test-light == 'true' }} shell: bash run: | make start-upgrade-test-light + container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}") + if [ -z "$container_id" ]; then + echo "Orchestrator container is not currently running. Exiting..." + exit 1 + fi + echo "Monitoring Orchestrator container with ID: $container_id" + while true; do + current_status=$(docker ps -q | grep $container_id || echo "docker-ps-error") + if [ "$current_status" == "docker-ps-error" ]; then + echo "***********************************" + echo "* *" + echo "* *" + echo "* TESTING COMPLETE *" + echo "* *" + echo "* *" + echo "***********************************" + docker logs $container_id || echo "no logs" + exit 0 + else + echo "Testing in progress still...." + if [ "${{ github.event.inputs.e2e-upgrade-test }}" == "true" ]; then + docker logs $container_id || echo "no logs" + fi + fi + sleep 5 + done e2e-performance-test: + if: ${{ github.event.inputs.e2e-performance-test == 'true' }} runs-on: buildjet-4vcpu-ubuntu-2204 timeout-minutes: 120 steps: - name: "Checkout Code" - if: ${{ github.event.inputs.e2e-performance-test == 'true' }} uses: actions/checkout@v3 - name: Execute Performance Tests - if: ${{ github.event.inputs.e2e-performance-test == 'true' }} shell: bash run: | make start-e2e-performance-test + container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}") + if [ -z "$container_id" ]; then + echo "Orchestrator container is not currently running. Exiting..." + exit 1 + fi + echo "Monitoring Orchestrator container with ID: $container_id" + while true; do + current_status=$(docker ps -q | grep $container_id || echo "docker-ps-error") + if [ "$current_status" == "docker-ps-error" ]; then + echo "***********************************" + echo "* *" + echo "* *" + echo "* TESTING COMPLETE *" + echo "* *" + echo "* *" + echo "***********************************" + docker logs $container_id || echo "no logs" + exit 0 + else + echo "Testing in progress still...." + if [ "${{ github.event.inputs.e2e-upgrade-test }}" == "true" ]; then + docker logs $container_id || echo "no logs" + fi + fi + sleep 5 + done \ No newline at end of file diff --git a/changelog.md b/changelog.md index c9447ef1fd..a75fda8219 100644 --- a/changelog.md +++ b/changelog.md @@ -56,6 +56,7 @@ * [1814](https://github.com/zeta-chain/node/pull/1814) - fix code coverage ignore for protobuf generated files ### CI +* [1945](https://github.com/zeta-chain/node/pull/1945) - update advanced testing pipeline to not execute tests that weren't selected so they show skipped instead of skipping steps. * [1940](https://github.com/zeta-chain/node/pull/1940) - adjust release pipeline to be created as pre-release instead of latest * [1867](https://github.com/zeta-chain/node/pull/1867) - default restore_type for full node docker-compose to snapshot instead of statesync for reliability. * [1891](https://github.com/zeta-chain/node/pull/1891) - fix typo that was introduced to docker-compose and a typo in start.sh for the docker start script for full nodes. diff --git a/contrib/localnet/orchestrator/start-zetae2e.sh b/contrib/localnet/orchestrator/start-zetae2e.sh index 129317932d..6f75ae7cc5 100644 --- a/contrib/localnet/orchestrator/start-zetae2e.sh +++ b/contrib/localnet/orchestrator/start-zetae2e.sh @@ -51,8 +51,8 @@ if [ "$OPTION" == "upgrade" ]; then # Run the e2e tests, then restart zetaclientd at upgrade height and run the e2e tests again - # Fetch the height of the upgrade, default is 200, if arg3 is passed, use that value - UPGRADE_HEIGHT=${3:-200} + # Fetch the height of the upgrade, default is 225, if arg3 is passed, use that value + UPGRADE_HEIGHT=${3:-225} # Run zetae2e, if the upgrade height is lower than 100, we use the setup-only flag if [ "$UPGRADE_HEIGHT" -lt 100 ]; then diff --git a/contrib/localnet/scripts/start-zetacored.sh b/contrib/localnet/scripts/start-zetacored.sh index e5fde418d2..ab3725b4d5 100755 --- a/contrib/localnet/scripts/start-zetacored.sh +++ b/contrib/localnet/scripts/start-zetacored.sh @@ -210,8 +210,8 @@ else sleep 20 echo - # Fetch the height of the upgrade, default is 200, if arg3 is passed, use that value - UPGRADE_HEIGHT=${3:-200} + # Fetch the height of the upgrade, default is 225, if arg3 is passed, use that value + UPGRADE_HEIGHT=${3:-225} # If this is the first node, create a governance proposal for upgrade if [ $HOSTNAME = "zetacore0" ]