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

difftreelog

ci(collator) fix test timeout + opal runtime

Fahrrader2023-01-18parent: #d10b99e.patch.diff
in: master

2 files changed

modified.github/workflows/collator-selection.ymldiffbeforeafterboth
before Β· .github/workflows/collator-selection.yml
1name: collator-selection-test-run23# Triger: only call from main workflow(re-usable workflows)4on:5  workflow_call:67# A workflow run is made up of one or more jobs that can run sequentially or in parallel8jobs:9  execution-marix:10    name: Prepare execution matrix1112    runs-on: self-hosted-ci13    outputs:14      matrix: ${{ steps.create_matrix.outputs.matrix }}1516    steps:1718      - name: Clean Workspace19        uses: AutoModality/action-clean@v1.1.02021      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it22      - uses: actions/checkout@v323        with:24          ref: ${{ github.head_ref }}  #Checking out head commit2526      - name: Read .env file27        uses: xom9ikk/dotenv@v22829      - name: Create Execution matrix30        uses: CertainLach/create-matrix-action@v331        id: create_matrix32        with:33          matrix: |34            network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}35            network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}3637  collator-selection:38    needs: execution-marix39    # The type of runner that the job will run on40    runs-on: [self-hosted-ci,large]41    timeout-minutes: 13804243    name: ${{ matrix.network }}44    strategy:45      matrix:46        include: ${{fromJson(needs.execution-marix.outputs.matrix)}}4748    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.4950    steps:51      - name: Clean Workspace52        uses: AutoModality/action-clean@v1.1.05354      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it55      - uses: actions/checkout@v356        with:57          ref: ${{ github.head_ref }}  #Checking out head commit5859      - name: Read .env file60        uses: xom9ikk/dotenv@v26162      - name: Generate ENV related extend file for docker-compose63        uses: cuchi/jinja2-action@v1.2.064        with:65          template: .docker/docker-compose.tmp-collators.j266          output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml67          variables: |68            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}69            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}70            POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}71            NETWORK=${{ matrix.network }}72            BRANCH=${{ github.head_ref }}7374      - name: Show build configuration75        run: cat .docker/docker-compose.collators.${{ matrix.network }}.yml7677      - name: Show launch-config configuration78        run: cat launch-config.json7980      - name: Build the stack81        run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 3008283      #  πŸš€ POLKADOT LAUNCH COMPLETE πŸš€84      - name: Check if docker logs consist messages related to testing of collator tests 85        if: success()86        run: |87          counter=16088          function check_container_status {89                docker inspect -f {{.State.Running}} parachain-collators90          }91          function do_docker_logs {92                docker logs --details parachain-collators  2>&193          }94          function is_started {95                if [ "$(check_container_status)" == "true" ]; then96                        echo "Container: collator-${{ matrix.network }}-testnet-local RUNNING";97                        echo "Check Docker logs"98                        DOCKER_LOGS=$(do_docker_logs)99                        if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then100                                echo "πŸš€ POLKADOT LAUNCH COMPLETE πŸš€"101                                return 0102                        else103                                echo "Message not found in logs output, repeating..."104                                return 1105                        fi106                else107                        echo "Container collator-${{ matrix.network }}-testnet-local NOT RUNNING"108                        echo "Halting all future checks"109                        exit 1110                fi111          echo "something goes wrong"112          exit 1113          }114          while ! is_started; do115                echo "Waiting for special message in log files "116                sleep 30s117                counter=$(( $counter - 1 ))118                echo "Counter: $counter"119                if [ "$counter" -gt "0" ]; then120                         continue121                else122                         break123                fi124          done125          echo "Halting script"126          exit 0127        shell: bash128129      - uses: actions/setup-node@v3130        with:131          node-version: 16132133      - name: Run Collator tests134        working-directory: tests135        if: success() || failure()136        run: |137          yarn install138          yarn add mochawesome139          node scripts/readyness.js140          echo "Ready to start tests"141          yarn polkadot-types142          NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW}143        env:144          RPC_URL: http://127.0.0.1:9933/145146      - name: Test Report Collator147        uses: phoenix-actions/test-reporting@v8148        id: test-report-collator149        if: success() || failure()    # run this step even if previous step failed150        with:151          name: Report Collator tests results - ${{ matrix.network }}            # Name of the check run which will be created152          path: tests/mochawesome-report/test-collators-*.json    # Path to test results153          reporter: mochawesome-json154          fail-on-error: 'false'155156      - name: Stop running containers157        if: always()                   # run this step always158        run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" down159160      - name: Remove builder cache161        if: always()                   # run this step always162        run: |163          docker builder prune -f -a164          docker system prune -f
after Β· .github/workflows/collator-selection.yml
1name: collator-selection-test-run23# Triger: only call from main workflow(re-usable workflows)4on:5  workflow_call:67# A workflow run is made up of one or more jobs that can run sequentially or in parallel8jobs:9  execution-marix:10    name: Prepare execution matrix1112    runs-on: self-hosted-ci13    outputs:14      matrix: ${{ steps.create_matrix.outputs.matrix }}1516    steps:1718      - name: Clean Workspace19        uses: AutoModality/action-clean@v1.1.02021      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it22      - uses: actions/checkout@v323        with:24          ref: ${{ github.head_ref }}  #Checking out head commit2526      - name: Read .env file27        uses: xom9ikk/dotenv@v22829      - name: Create Execution matrix30        uses: CertainLach/create-matrix-action@v331        id: create_matrix32        with:33          matrix: |34            network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}35            network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}36            network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}3738  collator-selection:39    needs: execution-marix40    # The type of runner that the job will run on41    runs-on: [self-hosted-ci,large]42    timeout-minutes: 13804344    name: ${{ matrix.network }}45    strategy:46      matrix:47        include: ${{fromJson(needs.execution-marix.outputs.matrix)}}4849    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.5051    steps:52      - name: Clean Workspace53        uses: AutoModality/action-clean@v1.1.05455      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it56      - uses: actions/checkout@v357        with:58          ref: ${{ github.head_ref }}  #Checking out head commit5960      - name: Read .env file61        uses: xom9ikk/dotenv@v26263      - name: Generate ENV related extend file for docker-compose64        uses: cuchi/jinja2-action@v1.2.065        with:66          template: .docker/docker-compose.tmp-collators.j267          output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml68          variables: |69            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}70            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}71            POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}72            NETWORK=${{ matrix.network }}73            BRANCH=${{ github.head_ref }}7475      - name: Show build configuration76        run: cat .docker/docker-compose.collators.${{ matrix.network }}.yml7778      - name: Show launch-config configuration79        run: cat launch-config.json8081      - name: Build the stack82        run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 3008384      #  πŸš€ POLKADOT LAUNCH COMPLETE πŸš€85      - name: Check if docker logs consist messages related to testing of collator tests 86        if: success()87        run: |88          counter=16089          function check_container_status {90                docker inspect -f {{.State.Running}} parachain-collators91          }92          function do_docker_logs {93                docker logs --details parachain-collators  2>&194          }95          function is_started {96                if [ "$(check_container_status)" == "true" ]; then97                        echo "Container: collator-${{ matrix.network }}-testnet-local RUNNING";98                        echo "Check Docker logs"99                        DOCKER_LOGS=$(do_docker_logs)100                        if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then101                                echo "πŸš€ POLKADOT LAUNCH COMPLETE πŸš€"102                                return 0103                        else104                                echo "Message not found in logs output, repeating..."105                                return 1106                        fi107                else108                        echo "Container collator-${{ matrix.network }}-testnet-local NOT RUNNING"109                        echo "Halting all future checks"110                        exit 1111                fi112          echo "something goes wrong"113          exit 1114          }115          while ! is_started; do116                echo "Waiting for special message in log files "117                sleep 30s118                counter=$(( $counter - 1 ))119                echo "Counter: $counter"120                if [ "$counter" -gt "0" ]; then121                         continue122                else123                         break124                fi125          done126          echo "Halting script"127          exit 0128        shell: bash129130      - uses: actions/setup-node@v3131        with:132          node-version: 16133134      - name: Run Collator tests135        working-directory: tests136        if: success() || failure()137        run: |138          yarn install139          yarn add mochawesome140          node scripts/readyness.js141          echo "Ready to start tests"142          yarn polkadot-types143          NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW}144        env:145          RPC_URL: http://127.0.0.1:9933/146147      - name: Test Report Collator148        uses: phoenix-actions/test-reporting@v8149        id: test-report-collator150        if: success() || failure()    # run this step even if previous step failed151        with:152          name: Report Collator tests results - ${{ matrix.network }}            # Name of the check run which will be created153          path: tests/mochawesome-report/test-collators-*.json    # Path to test results154          reporter: mochawesome-json155          fail-on-error: 'false'156157      - name: Stop running containers158        if: always()                   # run this step always159        run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" down160161      - name: Remove builder cache162        if: always()                   # run this step always163        run: |164          docker builder prune -f -a165          docker system prune -f
modifiedtests/package.jsondiffbeforeafterboth
--- a/tests/package.json
+++ b/tests/package.json
@@ -88,9 +88,9 @@
     "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts",
     "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts",
     "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",
-    "testCollators": "RUN_COLLATOR_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/collator-selection/**.*test.ts",
-    "testCollatorSelection": "RUN_COLLATOR_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/collatorSelection.*test.ts",
-    "testIdentity": "RUN_COLLATOR_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/identity.*test.ts",
+    "testCollators": "RUN_COLLATOR_TESTS=1 mocha --timeout 49999999 -r ts-node/register ./**/collator-selection/**.*test.ts",
+    "testCollatorSelection": "RUN_COLLATOR_TESTS=1 mocha --timeout 49999999 -r ts-node/register ./**/collatorSelection.*test.ts",
+    "testIdentity": "RUN_COLLATOR_TESTS=1 mocha --timeout 49999999 -r ts-node/register ./**/identity.*test.ts",
     "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
     "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",
     "testEthCreateNFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createNFTCollection.test.ts",