git.delta.rocks / unique-network / refs/commits / 35dd1a696a4f

difftreelog

Change CI workflows for parallel tests

Max Andreev2022-10-18parent: #67c56fa.patch.diff
in: master

6 files changed

modified.docker/Dockerfile-parachain-node-onlydiffbeforeafterboth
--- a/.docker/Dockerfile-parachain-node-only
+++ b/.docker/Dockerfile-parachain-node-only
@@ -80,7 +80,7 @@
     nvm install v16.16.0 && \
     nvm use v16.16.0
 
-RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing
+RUN git clone https://github.com/uniquenetwork/polkadot-launch -b unique-network
 
 RUN export NVM_DIR="$HOME/.nvm" && \
     [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
modified.docker/docker-compose.tmp-node.j2diffbeforeafterboth
--- a/.docker/docker-compose.tmp-node.j2
+++ b/.docker/docker-compose.tmp-node.j2
@@ -24,9 +24,11 @@
     expose:
       - 9944
       - 9933
+      - 9844
     ports:
       - 127.0.0.1:9944:9944
       - 127.0.0.1:9933:9933
+      - 127.0.0.1:9844:9844
     logging:
       options:
         max-size: "1m"
modified.envdiffbeforeafterboth
--- a/.env
+++ b/.env
@@ -2,26 +2,25 @@
 POLKADOT_BUILD_BRANCH=release-v0.9.29
 
 POLKADOT_MAINNET_BRANCH=release-v0.9.26
+STATEMINT_BUILD_BRANCH=release-parachains-v9230
+ACALA_BUILD_BRANCH=2.9.2
+MOONBEAM_BUILD_BRANCH=runtime-1701
+
 UNIQUE_MAINNET_TAG=v924010
+UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443
 
 KUSAMA_MAINNET_BRANCH=release-v0.9.26
+STATEMINE_BUILD_BRANCH=parachains-v9270
+KARURA_BUILD_BRANCH=2.9.1
+MOONRIVER_BUILD_BRANCH=runtime-1701
+
 QUARTZ_MAINNET_TAG=quartz-v924012-2
+QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443
 
 UNQWND_MAINNET_BRANCH=release-v0.9.24
 
+WESTMINT_BUILD_BRANCH=parachains-v9270
+OPAL_MAINNET_TAG=v924010
 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443
-QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443
-UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443
 
 POLKADOT_LAUNCH_BRANCH=unique-network
-
-KARURA_BUILD_BRANCH=2.9.1
-ACALA_BUILD_BRANCH=2.9.2
-
-MOONRIVER_BUILD_BRANCH=runtime-1701
-MOONBEAM_BUILD_BRANCH=runtime-1701
-
-STATEMINE_BUILD_BRANCH=parachains-v9270
-STATEMINT_BUILD_BRANCH=release-parachains-v9230
-WESTMINT_BUILD_BRANCH=parachains-v9270
-
modified.github/workflows/forkless-update-nodata_v2.ymldiffbeforeafterboth
--- a/.github/workflows/forkless-update-nodata_v2.yml
+++ b/.github/workflows/forkless-update-nodata_v2.yml
@@ -33,7 +33,7 @@
         uses: xom9ikk/dotenv@v1.0.2
 
       - name: Create Execution matrix
-        uses: fabiocaccamo/create-matrix-action@v2
+        uses: CertainLach/create-matrix-action@v3
         id: create_matrix
         with:
           matrix: |
@@ -161,6 +161,50 @@
       - name: Show docker logs
         if: success() || failure()
         run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log'
+                
+      - name: Run Parellel tests 
+        working-directory: tests
+        run: |
+          yarn install
+          yarn add mochawesome
+          node scripts/readyness.js
+          echo "Ready to start tests"
+          yarn polkadot-types
+          NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
+        env:
+          RPC_URL: http://127.0.0.1:9933/
+    
+      - name: Test Report Parallel
+        uses: phoenix-actions/test-reporting@v8
+        id: test-report-parallel
+        if: success() || failure()    # run this step even if previous step failed
+        with:
+          name: Report Parallel tests results - ${{ matrix.network }}            # Name of the check run which will be created
+          path: tests/mochawesome-report/test-parallel-*.json    # Path to test results
+          reporter: mochawesome-json
+          fail-on-error: 'false'
+          
+      - name: Run Sequential tests 
+        working-directory: tests
+        run: |
+          yarn install
+          yarn add mochawesome
+          node scripts/readyness.js
+          echo "Ready to start tests"
+          yarn polkadot-types
+          NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
+        env:
+          RPC_URL: http://127.0.0.1:9933/
+    
+      - name: Test Report Sequential
+        uses: phoenix-actions/test-reporting@v8
+        id: test-report-sequential
+        if: success() || failure()    # run this step even if previous step failed
+        with:
+          name: Report Sequential tests results - ${{ matrix.network }}            # Name of the check run which will be created
+          path: tests/mochawesome-report/test-sequential-*.json    # Path to test results
+          reporter: mochawesome-json
+          fail-on-error: 'false'
 
       - name: Stop running containers
         if: always()                   # run this step always
modified.github/workflows/market-test_v2.ymldiffbeforeafterboth
--- a/.github/workflows/market-test_v2.yml
+++ b/.github/workflows/market-test_v2.yml
@@ -11,7 +11,7 @@
   market_test:
     # The type of runner that the job will run on
     runs-on: [self-hosted-ci,large]
-    timeout-minutes: 1380
+    timeout-minutes: 360
 
     name: ${{ matrix.network }}    
 
modified.github/workflows/node-only-update_v2.ymldiffbeforeafterboth
32 uses: xom9ikk/dotenv@v1.0.232 uses: xom9ikk/dotenv@v1.0.2
3333
34 - name: Create Execution matrix34 - name: Create Execution matrix
35 uses: fabiocaccamo/create-matrix-action@v235 uses: CertainLach/create-matrix-action@v3
36 id: create_matrix36 id: create_matrix
37 with:37 with:
38 matrix: |38 matrix: |
39 network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}39 network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}
40 network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}40 network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}
41 network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}41 network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}
4242
4343
4444
4949
5050
5151
52 timeout-minutes: 138052 timeout-minutes: 2880 # 48 hours for execution jobs.
5353
54 name: ${{ matrix.network }}54 name: ${{ matrix.network }}
5555
174 env:173 env:
175 RPC_URL: http://127.0.0.1:9933/174 RPC_URL: http://127.0.0.1:9933/
176175
177 - name: Test Report Before Node upgrade176 - name: Upload Test Report Before Node upgrade
178 uses: phoenix-actions/test-reporting@v8177 uses: phoenix-actions/test-reporting@v8
179 id: test-report-before178 id: test-report-before
180 if: success() || failure() # run this step even if previous step failed179 if: success() || failure() # run this step even if previous step failed
185 fail-on-error: 'false'184 fail-on-error: 'false'
186185
186
187 # TODO uncomment thease steps after the merge
188 #- name: Run Parallel tests before Node Parachain upgrade
189 # working-directory: ${{ matrix.mainnet_branch }}/tests
190 # run: |
191 # yarn install
192 # yarn add mochawesome
193 # echo "Ready to start tests"
194 # yarn polkadot-types
195 # NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
196 # env:
197 # RPC_URL: http://127.0.0.1:9933/
198
199 #- name: Upload Parallel Test Report Before Node upgrade
200 # uses: phoenix-actions/test-reporting@v8
201 # id: test-parallel-report-before
202 # if: success() || failure() # run this step even if previous step failed
203 # with:
204 # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created
205 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results
206 # reporter: mochawesome-json
207 # fail-on-error: 'false'
208
209 # - name: Run Sequential tests before Node Parachain upgrade
210 # if: success() || failure()
211 # working-directory: ${{ matrix.mainnet_branch }}/tests
212 # run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
213 # env:
214 # RPC_URL: http://127.0.0.1:9933/
215
216 # - name: Upload Sequential Test Report Before Node upgrade
217 # uses: phoenix-actions/test-reporting@v8
218 # id: test-sequential-report-before
219 # if: success() || failure() # run this step even if previous step failed
220 # with:
221 # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created
222 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results
223 # reporter: mochawesome-json
224 # fail-on-error: 'false'
225
187 - name: Send SIGUSR1 to polkadotlaunch process226 - name: Send SIGUSR1 to polkadot-launch process
188 if: success() || failure()227 if: success() || failure()
189 run: |228 run: |
190 #Get PID of polkadot-launch229 #Get PID of polkadot-launch
191 PID=$(docker exec node-parachain pidof 'polkadot-launch')230 ContainerID=$(docker ps -aqf "name=node-parachain")
231 PID=$(docker exec node-parachain pidof 'polkadot-launch')
192 echo "Polkadot-launch PID: $PID"232 echo "Polkadot-launch PID: $PID"
193 #Send SIGUSR1 signal to $PID233 #Send SIGUSR1 signal to $PID
194 docker exec node-parachain kill -SIGUSR1 ${PID}234 docker exec node-parachain kill -SIGUSR1 ${PID}
195235 echo "SIGUSR1 sent to Polkadot-launch PID: $PID"
196 # 🌗 All parachain collators restarted with the new binaries.236 docker logs ${ContainerID}
237
238 - name: Get chain logs in case of docker image crashed after Polkadot Launch restart
239 if: failure() # run this step only at failure
240 run: |
241 docker exec node-parachain cat /polkadot-launch/9944.log
242 docker exec node-parachain cat /polkadot-launch/9945.log
243 docker exec node-parachain cat /polkadot-launch/alice.log
244 docker exec node-parachain cat /polkadot-launch/eve.log
245 docker exec node-parachain cat /polkadot-launch/dave.log
246 docker exec node-parachain cat /polkadot-launch/charlie.log
247
248 # 🌗 All parachain collators restarted with the new binaries.
197 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.249 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.
198 if: success()250 if: success()
199 run: |251 run: |
239 exit 0291 exit 0
240 shell: bash292 shell: bash
241293
294 ## TODO: Remove next two blocks before switch to Parrallel & Sequental tests. Uncoment commented blocks.
242 - name: Run tests after Node Parachain upgrade295 - name: Run tests after Node Parachain upgrade
243 working-directory: tests296 working-directory: ${{ matrix.mainnet_branch }}/tests
244 run: |297 run: |
245 yarn install298 yarn install
246 yarn add mochawesome299 yarn add mochawesome
257 if: success() || failure() # run this step even if previous step failed310 if: success() || failure() # run this step even if previous step failed
258 with:311 with:
259 name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created312 name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created
260 path: tests/mochawesome-report/test-*.json # Path to test results313 path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results
261 reporter: mochawesome-json314 reporter: mochawesome-json
262 fail-on-error: 'false'315 fail-on-error: 'false'
316
317 # TODO uncomment thease steps after the merge
318 #- name: Run Parallel tests after Node Parachain upgrade
319 # working-directory: ${{ matrix.mainnet_branch }}/tests
320 # run: |
321 # yarn install
322 # yarn add mochawesome
323 # node scripts/readyness.js
324 # echo "Ready to start tests"
325 # yarn polkadot-types
326 # NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
327 # env:
328 # RPC_URL: http://127.0.0.1:9933/
329
330 #- name: Test Report Parallel After Node upgrade
331 # uses: phoenix-actions/test-reporting@v8
332 # id: test-report-parallel-after
333 # if: success() || failure() # run this step even if previous step failed
334 # with:
335 # name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created
336 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results
337 # reporter: mochawesome-json
338 # fail-on-error: 'false'
339
340 #- name: Run Sequential tests after Node Parachain upgrade
341 # if: success() || failure()
342 # working-directory: ${{ matrix.mainnet_branch }}/tests
343 # run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
344 # env:
345 # RPC_URL: http://127.0.0.1:9933/
346
347 #- name: Upload Sequential Test Report After Node upgrade
348 # uses: phoenix-actions/test-reporting@v8
349 # id: test-sequential-report-after
350 # if: success() || failure() # run this step even if previous step failed
351 # with:
352 # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created
353 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results
354 # reporter: mochawesome-json
355 # fail-on-error: 'false'
263356
264357
265 - name: Stop running containers358 - name: Stop running containers
273 docker system prune -f366 docker system prune -f
274 docker image prune -f -a367 docker image prune -f -a
275368
276 - name: Clean Workspace369 - name: Remove repo at the end
277 if: always()370 if: always() # run this step always
278 uses: AutoModality/action-clean@v1.1.0371 run: |
372 ls -ls ./
279373