difftreelog
tests: check if docker exec sends SIGUSR1 to polkadot-launch correct
in: master
1 file changed
.github/workflows/nodes-only-update.ymldiffbeforeafterboth137 - name: Show launch-config-forkless configuration137 - name: Show launch-config-forkless configuration138 run: cat .docker/launch-config-forkless-nodata.json138 run: cat .docker/launch-config-forkless-nodata.json139139140 - uses: actions/setup-node@v3141 with:142 node-version: 16140143141 - name: Build the stack144 - name: Build the stack142 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300145 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300143146147148 - name: Temp Wait. Will be remove after send SIGUSER to polkadot-launch149 run: sleep 600s150151# - name: Run tests before Node Parachain upgrade152# run: |153# cd tests154# yarn install155# yarn add mochawesome156# echo "Ready to start tests"157# node scripts/readyness.js158# NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}159# env:160# RPC_URL: http://127.0.0.1:9933/161#162# - name: Test Report Before Node upgrade163# uses: phoenix-actions/test-reporting@v8164# id: test-report-before165# if: success() || failure() # run this step even if previous step failed166# with:167# name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created168# path: tests/mochawesome-report/test-*.json # Path to test results169# reporter: mochawesome-json170# fail-on-error: 'false'171172 - name: Send SIGUSR1 to polkadotlaunch process173 if: success()174 run: |175 #Get PID of polkadot-launch176 PID=$(docker exec -it node-parachain pidof 'polkadot-launch')177 #Send SIGUSR1 signal to $PID178 docker exec -it node-parachain kill -SIGUSR1 $(PID)179180 # 🌗 All parachain collators restarted with the new binaries.144 - name: Check if docker logs consist logs related to Runtime Upgrade testing.181 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.145 if: success()182 if: success()146 run: |183 run: |147 counter=160184 counter=160148 function check_container_status {185 function check_container_status {149 docker inspect -f {{.State.Running}} node-parachain186 docker inspect -f {{.State.Running}} node-parachain150 }187 }151 function do_docker_logs {188 function do_docker_logs {152 docker logs --details node-parachain 2>&1189 docker logs --details node-parachain 2>&1153 }190 }154 function is_started {191 function is_started {155 if [ "$(check_container_status)" == "true" ]; then192 if [ "$(check_container_status)" == "true" ]; then156 echo "Container: node-parachain RUNNING";193 echo "Container: node-parachain RUNNING";157 echo "Check Docker logs"194 echo "Check Docker logs"158 DOCKER_LOGS=$(do_docker_logs)195 DOCKER_LOGS=$(do_docker_logs)159 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then196 if [[ ${DOCKER_LOGS} = *"🌗 All parachain collators restarted with the new binaries."* ]];then160 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"197 echo "🌗 All parachain collators restarted with the new binaries."161 return 0162 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED ��"* ]];then198 return 0163 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED ��"164 return 1199 else165 else200 echo "Message not found in logs output, repeating..."166 echo "Message not found in logs output, repeating..."201 return 1167 return 1202 fi168 fi203 else169 else204 echo "Container node-parachain NOT RUNNING"170 echo "Container node-parachain not RUNNING"205 echo "Halting all future checks"171 echo "Halting all future checks"206 exit 1172 exit 1207 fi173 fi208 echo "something goes wrong"174 exit 0209 exit 1175 }210 }176 while ! is_started; do211 while ! is_started; do177 echo "Waiting for special message in log files "212 echo "Waiting for special message in log files "178 sleep 30s213 sleep 30s179 counter=$(( $counter - 1 ))214 counter=$(( $counter - 1 ))180 echo "Counter: $counter"215 echo "Counter: $counter"181 if [ "$counter" -gt "0" ]; then216 if [ "$counter" -gt "0" ]; then182 continue217 continue183 else218 else184 break219 break185 fi220 fi186 done221 done187 echo "Halting script"222 echo "Halting script"188 exit 0223 exit 0189 shell: bash224 shell: bash190225191 - name: Collect Docker Logs226 - name: Run tests after Node Parachain upgrade192 if: success() || failure()193 uses: jwalton/gh-docker-logs@v2.2.0227 run: |194 with:228 cd tests229 yarn install230 yarn add mochawesome231 echo "Ready to start tests"232 node scripts/readyness.js233 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}195 dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}'234 env:196 images: 'node-parachain'235 RPC_URL: http://127.0.0.1:9933/197236198 - name: Show docker logs237 - name: Test Report After Node upgrade238 uses: phoenix-actions/test-reporting@v8239 id: test-report-after199 if: success() || failure()240 if: success() || failure() # run this step even if previous step failed200 run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log'241 with:242 name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created243 path: tests/mochawesome-report/test-*.json # Path to test results244 reporter: mochawesome-json245 fail-on-error: 'false'246201247202 - name: Stop running containers248 - name: Stop running containers