git.delta.rocks / unique-network / refs/commits / 6a048d7eaf42

difftreelog

rename node-only-update_v3 to integration-tests

Konstantin Astakhov2022-10-21parent: #e27974f.patch.diff
in: master

3 files changed

modified.github/workflows/ci-develop.ymldiffbeforeafterboth
--- a/.github/workflows/ci-develop.yml
+++ b/.github/workflows/ci-develop.yml
@@ -40,12 +40,12 @@
     uses: ./.github/workflows/forkless.yml
   
   node-only-update:
-    if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }}  # Conditional check for draft & labels per job.
+    if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'node-only-update')) }}  # Conditional check for draft & labels per job.
     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')) }}      # Conditional check for draft & labels per job.
-    uses: ./.github/workflows/node-only-update_v3.yml
+    if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'integration')) }}      # Conditional check for draft & labels per job.
+    uses: ./.github/workflows/integration-tests.yml
 
   codestyle:
     if: github.event.pull_request.draft == false                                                                             # Conditional check for draft per job.
added.github/workflows/integration-tests.ymldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/integration-tests.yml
@@ -0,0 +1,339 @@
+# Test workflow for debug parallel and sequental tests in scope of execution time reducing.
+name: Integration tests
+
+# Triger: only call from main workflow(re-usable workflows)
+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.OPAL_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 }}}
+ 
+  parallel-test:
+    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 }} - parallel
+
+    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: 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: tests/mochawesome-report/test-parallel-*.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()
+        run: ls -la ./
+
+  sequential-test:
+    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 }} - sequential
+
+    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 Sequential tests on Node Parachain
+        working-directory: 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: 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()
+        run: ls -la ./
deleted.github/workflows/node-only-update_v3.ymldiffbeforeafterboth

no changes