Browse Source

Update run-integration-tests.yml workflow

Leszek Wiesner 3 years ago
parent
commit
17ca2b8286

+ 0 - 181
.github/workflows-disabled/run-network-tests.yml

@@ -1,181 +0,0 @@
-name: run-network-tests
-on:
-  pull_request:
-    types: [opened, synchronize]
-
-  workflow_dispatch:
-    # TODO: add an input so dispatcher can specify a list of tests to run,
-    # composed of the job ids separated by `:`
-    # for eg.
-    #   'network_tests_1:network_tests_3'
-    #   'network_tests_2'
-    # inputs:
-    #   test_to_run:
-    #     description: 'Tests to run'
-    #     required: false
-    #     default: 'all'
-
-jobs:
-  build_images:
-    name: Build joystream/node
-    runs-on: ubuntu-latest
-    outputs:
-      use_artifact: ${{ steps.compute_shasum.outputs.shasum }}-joystream-node-docker-image.tar.gz
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v1
-        with:
-          node-version: '14.x'
-
-      - id: compute_shasum
-        name: Compute runtime code shasum
-        run: |
-          export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
-          echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
-
-      - name: Setup cache directory
-        run: mkdir ~/docker-images
-
-      - name: Cache docker images
-        uses: actions/cache@v2
-        env:
-          cache-name: joystream-node-docker
-        with:
-          path: ~/docker-images
-          key: ${{ env.cache-name }}-${{ steps.compute_shasum.outputs.shasum }}
-
-      - name: Check if we have cached image
-        continue-on-error: true
-        run: |
-          if [ -f ~/docker-images/joystream-node-docker-image.tar.gz ]; then
-            docker load --input ~/docker-images/joystream-node-docker-image.tar.gz
-            cp ~/docker-images/joystream-node-docker-image.tar.gz .
-          fi
-
-      - name: Check if we have pre-built image on Dockerhub
-        continue-on-error: true
-        run: |
-          if ! [ -f joystream-node-docker-image.tar.gz ]; then
-            docker pull joystream/node:${{ steps.compute_shasum.outputs.shasum }}
-            docker image tag joystream/node:${{ steps.compute_shasum.outputs.shasum }} joystream/node:latest
-            docker save --output joystream-node-docker-image.tar joystream/node:latest
-            gzip joystream-node-docker-image.tar
-            cp joystream-node-docker-image.tar.gz ~/docker-images/
-          fi
-
-      - name: Build new joystream/node image
-        run: |
-          if ! [ -f joystream-node-docker-image.tar.gz ]; then
-            docker build . --file joystream-node.Dockerfile --tag joystream/node
-            docker save --output joystream-node-docker-image.tar joystream/node
-            gzip joystream-node-docker-image.tar
-            cp joystream-node-docker-image.tar.gz ~/docker-images/
-          fi
-
-      - name: Save joystream/node image to Artifacts
-        uses: actions/upload-artifact@v2
-        with:
-          name: ${{ steps.compute_shasum.outputs.shasum }}-joystream-node-docker-image.tar.gz
-          path: joystream-node-docker-image.tar.gz
-
-  basic_runtime_with_upgrade:
-    # if: ${{ false }}
-    name: Integration Tests (Runtime Upgrade)
-    needs: build_images
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v1
-        with:
-          node-version: '14.x'
-      - name: Get artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: ${{ needs.build_images.outputs.use_artifact }}
-      - name: Install artifacts
-        run: |
-          docker load --input joystream-node-docker-image.tar.gz
-          docker images
-      - name: Install packages and dependencies
-        run: |
-          yarn install --frozen-lockfile
-          yarn workspace @joystream/types build
-          yarn workspace @joystream/metadata-protobuf build
-          yarn workspace @joystream/cli build
-      - name: Ensure tests are runnable
-        run: yarn workspace network-tests build
-      - name: Install joystream-cli @joystream/cli/0.5.1
-        run: npm -g install @joystream/cli
-      - name: Execute network tests
-        run: |
-          export HOME=${PWD}
-          mkdir -p ${HOME}/.local/share/joystream-cli
-          joystream-cli api:setUri ws://localhost:9944
-          export RUNTIME=sumer
-          export TARGET_RUNTIME_TAG=latest
-          tests/network-tests/run-migration-tests.sh
-
-  basic_runtime:
-    name: Integration Tests (New Chain)
-    needs: build_images
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v1
-        with:
-          node-version: '14.x'
-      - name: Get artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: ${{ needs.build_images.outputs.use_artifact }}
-      - name: Install artifacts
-        run: |
-          docker load --input joystream-node-docker-image.tar.gz
-          docker images
-      - name: Install packages and dependencies
-        run: |
-          yarn install --frozen-lockfile
-          yarn workspace @joystream/types build
-          yarn workspace @joystream/metadata-protobuf build
-          yarn workspace @joystream/cli build
-      - name: Ensure tests are runnable
-        run: yarn workspace network-tests build
-      - name: Execute network tests
-        run: |
-          export RUNTIME=latest
-          tests/network-tests/run-full-tests.sh
-
-  new_chain_setup:
-    name: Initialize new chain
-    needs: build_images
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v1
-        with:
-          node-version: '14.x'
-      - name: Get artifacts
-        uses: actions/download-artifact@v2
-        with:
-          name: ${{ needs.build_images.outputs.use_artifact }}
-      - name: Install artifacts
-        run: |
-          docker load --input joystream-node-docker-image.tar.gz
-          docker images
-      - name: Install packages and dependencies
-        run: |
-          yarn install --frozen-lockfile
-          yarn workspace @joystream/types build
-          yarn workspace @joystream/metadata-protobuf build
-          yarn workspace @joystream/cli build
-      - name: Ensure query-node builds
-        run: yarn workspace query-node-root build
-      - name: Ensure tests are runnable
-        run: yarn workspace network-tests build
-      # Bring up hydra query-node development instance, then run content directory
-      # integration tests
-      - name: Execute Tests
-        run: |
-          export RUNTIME=latest
-          tests/network-tests/test-setup-new-chain.sh
-

+ 14 - 40
.github/workflows/run-integration-tests.yml

@@ -83,37 +83,8 @@ jobs:
           name: ${{ steps.compute_shasum.outputs.shasum }}-joystream-node-docker-image.tar.gz
           path: joystream-node-docker-image.tar.gz
 
-  # query_node:
-  #   name: Query Node Integration Tests
-  #   needs: build_images
-  #   runs-on: ubuntu-latest
-  #   steps:
-  #     - uses: actions/checkout@v1
-  #     - uses: actions/setup-node@v1
-  #       with:
-  #         node-version: '14.x'
-  #     - name: Get artifacts
-  #       uses: actions/download-artifact@v2
-  #       with:
-  #         name: ${{ needs.build_images.outputs.use_artifact }}
-  #     - name: Install artifacts
-  #       run: |
-  #         docker load --input joystream-node-docker-image.tar.gz
-  #         docker images
-  #     - name: Install packages and dependencies
-  #       run: |
-  #         yarn install --frozen-lockfile
-  #         yarn workspace @joystream/types build
-  #         yarn workspace @joystream/metadata-protobuf build
-  #     - name: Ensure tests are runnable
-  #       run: yarn workspace integration-tests build
-  #     # Bring up hydra query-node development instance, then run integration tests
-  #     - name: Execute Tests
-  #       run: |
-  #         export JOYSTREAM_NODE_TAG=latest
-  #         query-node/run-tests.sh
-  proposals_dev_chain:
-    name: Proposals (Dev chain)
+  basic_runtime:
+    name: Integration Tests (New Chain)
     needs: build_images
     runs-on: ubuntu-latest
     steps:
@@ -134,16 +105,16 @@ jobs:
           yarn install --frozen-lockfile
           yarn workspace @joystream/types build
           yarn workspace @joystream/metadata-protobuf build
+          yarn workspace @joystream/cli build
       - name: Ensure tests are runnable
         run: yarn workspace integration-tests build
-      # Bring up hydra query-node development instance, then run integration tests
-      - name: Execute Tests
+      - name: Execute network tests
         run: |
-          export JOYSTREAM_NODE_TAG=latest
-          ./tests/integration-tests/run-proposals-tests.sh
+          export RUNTIME=latest
+          tests/integration-tests/run-full-tests.sh
 
-  proposals_custom_chain:
-    name: Proposals (Custom chainspec chain)
+  new_chain_setup:
+    name: Initialize new chain
     needs: build_images
     runs-on: ubuntu-latest
     steps:
@@ -164,11 +135,14 @@ jobs:
           yarn install --frozen-lockfile
           yarn workspace @joystream/types build
           yarn workspace @joystream/metadata-protobuf build
+          yarn workspace @joystream/cli build
+      - name: Ensure query-node builds
+        run: yarn workspace query-node-root build
       - name: Ensure tests are runnable
         run: yarn workspace integration-tests build
-      # Bring up hydra query-node development instance, then run integration tests
+      # Bring up hydra query-node development instance, then run content directory
+      # integration tests
       - name: Execute Tests
         run: |
           export RUNTIME=latest
-          export JOYSTREAM_NODE_TAG=latest
-          CHAINSPEC_NODE=true ./tests/integration-tests/run-proposals-tests.sh
+          tests/integration-tests/test-setup-new-chain.sh