git.delta.rocks / unique-network / refs/commits / eec94d14a3e5

difftreelog

Merge branch 'rapid-parallel-start' into develop

Alex2022-10-18parents: #429358c #4dd77f9.patch.diff
in: master

4 files changed

modified.docker/Dockerfile-parachain-upgradediffbeforeafterboth
--- a/.docker/Dockerfile-parachain-upgrade
+++ b/.docker/Dockerfile-parachain-upgrade
@@ -81,7 +81,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" && \
added.docker/forkless-config/launch-config-node-update-only-v3.j2diffbeforeafterboth
after · .docker/forkless-config/launch-config-node-update-only-v3.j2
1{2      "relaychain": {3        "bin": "/polkadot/target/release/polkadot",4        "upgradeBin": "/polkadot/target/release/polkadot",5        "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm",6        "chain": "rococo-local",7        "nodes": [8            {9                "name": "alice",10                "wsPort": 9844,11                "rpcPort": 9843,12                "port": 30444,13                "flags": [14                    "-lparachain::candidate_validation=debug",15                    "-lxcm=trace",16                    "--rpc-cors=all",17                    "--unsafe-rpc-external",18                    "--unsafe-ws-external"19                ]20            },21            {22                "name": "bob",23                "wsPort": 9855,24                "rpcPort": 9854,25                "port": 30555,26                "flags": [27                    "-lparachain::candidate_validation=debug",28                    "-lxcm=trace",29                    "--rpc-cors=all",30                    "--unsafe-rpc-external",31                    "--unsafe-ws-external"32                ]33            },34            {35                "name": "charlie",36                "wsPort": 9866,37                "rpcPort": 9865,38                "port": 30666,39                "flags": [40                    "-lparachain::candidate_validation=debug",41                    "-lxcm=trace",42                    "--rpc-cors=all",43                    "--unsafe-rpc-external",44                    "--unsafe-ws-external"45                ]46            },47            {48                "name": "dave",49                "wsPort": 9877,50                "rpcPort": 9876,51                "port": 30777,52                "flags": [53                    "-lparachain::candidate_validation=debug",54                    "-lxcm=trace",55                    "--rpc-cors=all",56                    "--unsafe-rpc-external",57                    "--unsafe-ws-external"58                ]59            },60            {61                "name": "eve",62                "wsPort": 9888,63                "rpcPort": 9887,64                "port": 30888,65                "flags": [66                    "-lparachain::candidate_validation=debug",67                    "-lxcm=trace",68                    "--rpc-cors=all",69                    "--unsafe-rpc-external",70                    "--unsafe-ws-external"71                ]72            }73        ],74        "genesis": {75            "runtime": {76                "runtime_genesis_config": {77                    "parachainsConfiguration": {78                        "config": {79                            "validation_upgrade_frequency": 1,80                            "validation_upgrade_delay": 181                        }82                    }83                }84            }85        }86    },87      "parachains": [88        {89            "bin": "/unique-chain/current/release/unique-collator",90            "upgradeBin": "/unique-chain/target/release/unique-collator",91            "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm",92            "id": "1000",93            "balance": "1000000000000000000000000",94            "nodes": [95                {96                    "port": 31200,97                    "wsPort": 9944,98                    "rpcPort": 9933,99                    "name": "alice",100                    "flags": [101                        "--rpc-cors=all",102                        "--unsafe-rpc-external",103                        "--unsafe-ws-external",104                        "-lxcm=trace",105                        "--ws-max-connections=1000"106                    ]107                },108                {109                    "port": 31201,110                    "wsPort": 9945,111                    "rpcPort": 9934,112                    "name": "bob",113                    "flags": [114                        "--rpc-cors=all",115                        "--unsafe-rpc-external",116                        "--unsafe-ws-external",117                        "-lxcm=trace",118                        "--ws-max-connections=1000"119                    ]120                }121            ]122        }123    ],124    "simpleParachains": [],125    "hrmpChannels": [],126    "finalization": false127}
modified.github/workflows/ci-develop.ymldiffbeforeafterboth
--- a/.github/workflows/ci-develop.yml
+++ b/.github/workflows/ci-develop.yml
@@ -33,10 +33,15 @@
   forkless:
     if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }}
     uses: ./.github/workflows/forkless.yml
-  
+
   node-only-update:
     if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }}
     uses: ./.github/workflows/node-only-update_v2.yml
+    
+  parallel_and_sequential_tests:
+    if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }}
+    uses: ./.github/workflows/node-only-update_v3.yml
+
 
   codestyle:
     if: github.event.pull_request.draft == false
added.github/workflows/node-only-update_v3.ymldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/node-only-update_v3.yml
@@ -0,0 +1,212 @@
+name: Parallele tests
+
+# Controls when the action will run.
+on:
+  workflow_call:
+#Define Workflow variables
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+
+  nodes-execution-matrix:
+
+    name: execution matrix
+
+    runs-on: self-hosted-ci
+    outputs:
+      matrix: ${{ steps.create_matrix.outputs.matrix }}
+
+    steps:
+
+      - name: Clean Workspace
+        uses: AutoModality/action-clean@v1.1.0
+
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
+
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v1.0.2
+
+      - name: Create Execution matrix
+        uses: fabiocaccamo/create-matrix-action@v2
+        id: create_matrix
+        with:
+          matrix: |
+            network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}
+            network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}
+            network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}
+ 
+  nodes-only-update:
+    needs: nodes-execution-matrix
+    # The type of runner that the job will run on
+    runs-on: [self-hosted-ci,large]
+
+
+
+    timeout-minutes: 1380
+
+    name: ${{ matrix.network }}
+
+    continue-on-error: true         #Do not stop testing of matrix runs failed.  As it decided during PR review - it required 50/50& Let's check it with false.
+
+    strategy:
+      matrix:
+        include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}}
+
+    steps:
+
+      - name: Clean Workspace
+        uses: AutoModality/action-clean@v1.1.0
+
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
+
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v1.0.2
+
+      - name: Generate ENV related extend file for docker-compose
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/docker-compose.tmp-node.j2
+          output_file: .docker/docker-compose.node.${{ matrix.network }}.yml
+          variables: |
+            REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+            POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}
+            MAINNET_TAG=${{ matrix.mainnet_tag }}
+            MAINNET_BRANCH=${{ matrix.mainnet_branch }}
+            FEATURE=${{ matrix.features }}
+            RUNTIME=${{ matrix.runtime }}
+            BRANCH=${{ github.head_ref }}
+            
+      - name: Show build configuration
+        run: cat .docker/docker-compose.node.${{ matrix.network }}.yml
+
+      - name: Generate launch-config-forkless-nodata.json
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/forkless-config/launch-config-node-update-only-v3.j2
+          output_file: .docker/launch-config-forkless-nodata.json
+          variables: |
+            FEATURE=${{ matrix.features }}
+            RUNTIME=${{ matrix.runtime }}
+            
+      - 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 --remove-orphans --force-recreate --timeout 300
+
+      #  🚀 POLKADOT LAUNCH COMPLETE 🚀
+      - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.
+        if: success()
+        run: |
+          counter=160
+          function check_container_status {
+                docker inspect -f {{.State.Running}} node-parachain
+          }
+          function do_docker_logs {
+                docker logs --details node-parachain  2>&1
+          }
+          function is_started {
+                if [ "$(check_container_status)" == "true" ]; then
+                        echo "Container: node-parachain RUNNING";
+                        echo "Check Docker logs"
+                        DOCKER_LOGS=$(do_docker_logs)
+                        if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
+                                echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"
+                                return 0
+                        else
+                                echo "Message not found in logs output, repeating..."
+                                return 1
+                        fi
+                else
+                        echo "Container node-parachain NOT RUNNING"
+                        echo "Halting all future checks"
+                        exit 1
+                fi
+          echo "something goes wrong"
+          exit 1
+          }
+          while ! is_started; do
+                echo "Waiting for special message in log files "
+                sleep 30s
+                counter=$(( $counter - 1 ))
+                echo "Counter: $counter"
+                if [ "$counter" -gt "0" ]; then
+                         continue
+                else
+                         break
+                fi
+          done
+          echo "Halting script"
+          exit 0
+        shell: bash
+
+      - name: Run Parallel tests on Node Parachain
+        working-directory: ${{ matrix.mainnet_branch }}/tests
+        run: |
+          yarn install
+          yarn add mochawesome
+          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: Parallel Tests report
+        uses: phoenix-actions/test-reporting@v8
+        id: test-report-parallel
+        if: success() || failure()    # run this step even if previous step failed
+        with:
+          name: Parallel Tests report - ${{ matrix.network }}            # Name of the check run which will be created
+          path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json    # Path to test results
+          reporter: mochawesome-json
+          fail-on-error: 'false'
+    
+      - name: Run Sequential tests on Node Parachain
+        working-directory: ${{ matrix.mainnet_branch }}/tests
+        run: |
+          yarn install
+          yarn add mochawesome
+          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: Sequential Tests report
+        uses: phoenix-actions/test-reporting@v8
+        id: test-report-sequential
+        if: success() || failure()    # run this step even if previous step failed
+        with:
+          name: Parallel Tests report - ${{ matrix.network }}            # Name of the check run which will be created
+          path: ${{ matrix.mainnet_branch }}/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
+        run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes
+
+      - name: Remove builder cache
+        if: always()                   # run this step always
+        run: |
+          docker builder prune -f -a
+          docker system prune -f
+          docker image prune -f -a
+          
+#      - name: List files in Workspace
+#       if: always()
+#        uses: |
+#          ls -la ./
+#