From 70d58144dbd37dc75554feddcbafdb0599fbae0e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 14:19:37 +0000 Subject: [PATCH] tests: check if docker exec sends SIGUSR1 to polkadot-launch correct --- --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -137,11 +137,48 @@ - name: Show launch-config-forkless configuration run: cat .docker/launch-config-forkless-nodata.json + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - - name: Check if docker logs consist logs related to Runtime Upgrade testing. + + - name: Temp Wait. Will be remove after send SIGUSER to polkadot-launch + run: sleep 600s + +# - name: Run tests before Node Parachain upgrade +# run: | +# cd tests +# yarn install +# yarn add mochawesome +# echo "Ready to start tests" +# node scripts/readyness.js +# NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} +# env: +# RPC_URL: http://127.0.0.1:9933/ +# +# - name: Test Report Before Node upgrade +# uses: phoenix-actions/test-reporting@v8 +# id: test-report-before +# if: success() || failure() # run this step even if previous step failed +# with: +# name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created +# path: tests/mochawesome-report/test-*.json # Path to test results +# reporter: mochawesome-json +# fail-on-error: 'false' + + - name: Send SIGUSR1 to polkadotlaunch process + if: success() + run: | + #Get PID of polkadot-launch + PID=$(docker exec -it node-parachain pidof 'polkadot-launch') + #Send SIGUSR1 signal to $PID + docker exec -it node-parachain kill -SIGUSR1 $(PID) + + # 🌗 All parachain collators restarted with the new binaries. + - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. if: success() run: | counter=160 @@ -156,22 +193,20 @@ echo "Container: node-parachain RUNNING"; echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + if [[ ${DOCKER_LOGS} = *"🌗 All parachain collators restarted with the new binaries."* ]];then + echo "🌗 All parachain collators restarted with the new binaries." return 0 - elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then - echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧" - return 1 else echo "Message not found in logs output, repeating..." return 1 fi else - echo "Container node-parachain not RUNNING" + echo "Container node-parachain NOT RUNNING" echo "Halting all future checks" exit 1 fi - exit 0 + echo "something goes wrong" + exit 1 } while ! is_started; do echo "Waiting for special message in log files " @@ -188,16 +223,27 @@ exit 0 shell: bash - - name: Collect Docker Logs - if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 + - name: Run tests after Node Parachain upgrade + run: | + cd tests + yarn install + yarn add mochawesome + echo "Ready to start tests" + node scripts/readyness.js + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report After Node upgrade + uses: phoenix-actions/test-reporting@v8 + id: test-report-after + if: success() || failure() # run this step even if previous step failed with: - dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' - images: 'node-parachain' + name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' - - name: Show docker logs - if: success() || failure() - run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers if: always() # run this step always -- gitstuff