git.delta.rocks / unique-network / refs/commits / 70d58144dbd3

difftreelog

tests: check if docker exec sends SIGUSR1 to polkadot-launch correct

Alexander Aksenov2022-08-23parent: #e52bef4.patch.diff
in: master

1 file changed

modified.github/workflows/nodes-only-update.ymldiffbeforeafterboth
137 - name: Show launch-config-forkless configuration137 - name: Show launch-config-forkless configuration
138 run: cat .docker/launch-config-forkless-nodata.json138 run: cat .docker/launch-config-forkless-nodata.json
139139
140 - uses: actions/setup-node@v3
141 with:
142 node-version: 16
140143
141 - name: Build the stack144 - name: Build the stack
142 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 300
143146
147
148 - name: Temp Wait. Will be remove after send SIGUSER to polkadot-launch
149 run: sleep 600s
150
151# - name: Run tests before Node Parachain upgrade
152# run: |
153# cd tests
154# yarn install
155# yarn add mochawesome
156# echo "Ready to start tests"
157# node scripts/readyness.js
158# 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 upgrade
163# uses: phoenix-actions/test-reporting@v8
164# id: test-report-before
165# if: success() || failure() # run this step even if previous step failed
166# with:
167# name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created
168# path: tests/mochawesome-report/test-*.json # Path to test results
169# reporter: mochawesome-json
170# fail-on-error: 'false'
171
172 - name: Send SIGUSR1 to polkadotlaunch process
173 if: success()
174 run: |
175 #Get PID of polkadot-launch
176 PID=$(docker exec -it node-parachain pidof 'polkadot-launch')
177 #Send SIGUSR1 signal to $PID
178 docker exec -it node-parachain kill -SIGUSR1 $(PID)
179
180 # 🌗 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=160
148 function check_container_status {185 function check_container_status {
149 docker inspect -f {{.State.Running}} node-parachain186 docker inspect -f {{.State.Running}} node-parachain
150 }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>&1
153 }190 }
154 function is_started {191 function is_started {
155 if [ "$(check_container_status)" == "true" ]; then192 if [ "$(check_container_status)" == "true" ]; then
156 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."* ]];then
160 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"197 echo "🌗 All parachain collators restarted with the new binaries."
161 return 0
162 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED �"* ]];then198 return 0
163 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED �"
164 return 1199 else
165 else200 echo "Message not found in logs output, repeating..."
166 echo "Message not found in logs output, repeating..."201 return 1
167 return 1202 fi
168 fi203 else
169 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 1
172 exit 1207 fi
173 fi208 echo "something goes wrong"
174 exit 0209 exit 1
175 }210 }
176 while ! is_started; do211 while ! is_started; do
177 echo "Waiting for special message in log files "212 echo "Waiting for special message in log files "
178 sleep 30s213 sleep 30s
179 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" ]; then
182 continue217 continue
183 else218 else
184 break219 break
185 fi220 fi
186 done221 done
187 echo "Halting script"222 echo "Halting script"
188 exit 0223 exit 0
189 shell: bash224 shell: bash
190225
191 - name: Collect Docker Logs226 - name: Run tests after Node Parachain upgrade
192 if: success() || failure()
193 uses: jwalton/gh-docker-logs@v2.2.0227 run: |
194 with:228 cd tests
229 yarn install
230 yarn add mochawesome
231 echo "Ready to start tests"
232 node scripts/readyness.js
233 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/
197236
198 - name: Show docker logs237 - name: Test Report After Node upgrade
238 uses: phoenix-actions/test-reporting@v8
239 id: test-report-after
199 if: success() || failure()240 if: success() || failure() # run this step even if previous step failed
200 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 created
243 path: tests/mochawesome-report/test-*.json # Path to test results
244 reporter: mochawesome-json
245 fail-on-error: 'false'
246
201247
202 - name: Stop running containers248 - name: Stop running containers