git.delta.rocks / unique-network / refs/commits / 2469ee725ca5

difftreelog

correct and enable tests/scripts/readyness.js

Konstantin Astakhov2022-09-06parent: #c37bc7e.patch.diff
in: master

3 files changed

deleted.github/workflows/autogen-js-types.ymldiffbeforeafterboth
before · .github/workflows/autogen-js-types.yml
1name: yarn autogetn JS types23# Controls when the action will run.4on:5 # Triggers the workflow on push or pull request events but only for the master branch6  pull_request:7    branches:8      - develop9    types:10      - opened11      - reopened12      - synchronize   #commit(s) pushed to the pull request13      - ready_for_review1415  # Allows you to run this workflow manually from the Actions tab16  workflow_dispatch:1718#Define Workflow variables19env:20  REPO_URL: ${{ github.server_url }}/${{ github.repository }}2122concurrency: 23  group: ${{ github.workflow }}-${{ github.head_ref }}24  cancel-in-progress: true2526# A workflow run is made up of one or more jobs that can run sequentially or in parallel27jobs:28  29  autogen_js_types:30    # The type of runner that the job will run on31    runs-on: [self-hosted-ci,medium]32    timeout-minutes: 13803334    name: ${{ matrix.network }}3536    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.3738    strategy:39      matrix:40        include:41          - network: "opal"42            features: "opal-runtime"43            branch: "opal-testnet"44          - network: "quartz"45            features: "quartz-runtime"46            branch: "quartz-mainnet"47          - network: "unique"48            features: "unique-runtime"49            branch: "master"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@v1.0.26263      - name: Generate ENV related extend file for docker-compose64        uses: cuchi/jinja2-action@v1.2.065        with:66          template: .docker/docker-compose.tmp-dev.j267          output_file: .docker/docker-compose.${{ matrix.network }}.yml68          variables: |69            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}70            FEATURE=${{ matrix.features }}71    7273      - name: Show build configuration74        run: cat .docker/docker-compose.${{ matrix.network }}.yml7576      - name: Build the stack77        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans78 79      - name: Wait untill node-dev started.80        run: sleep 600s8182      - uses: actions/setup-node@v383        with:84          node-version: 168586      - name: Generate 87        working-directory: tests88        run: |89          yarn install90          yarn polkadot-types9192      - name: Checkout repo UniqueNetwork/unique-types-js93        uses: actions/checkout@v394        with:95          repository: 'UniqueNetwork/unique-types-js'96#          ssh-key: ${{ secrets.GH_PAT }}97          path: 'tests/unique-types-js'98#          ref: 'QA-65_maxandreev'99 100      - name: Copy files101        working-directory: tests102        run: |103          rsync -ar --exclude .gitignore src/interfaces/ unique-types-js104          for file in unique-types-js/augment-* unique-types-js/**/types.ts unique-types-js/registry.ts; do105              sed -i '1s;^;//@ts-nocheck\n;' $file106          done107108      - name: Enumerate files after generation109        working-directory: tests/unique-types-js110        run: |111          ls -la112113      - name: Enumerate files after generation114        working-directory: tests/115        run: |116          ls -la117118      - name: Upload JS types to repo119        working-directory: tests/unique-types-js120        run: |121          git config user.name github-actions122          git config user.email github-actions@github.com123          git add .124          git commit -m "chore: regenerate types"125   126      - name: Pushes to another repository127        id: push_directory128        uses: cpina/github-action-push-to-another-repository@main129        env:130          SSH_DEPLOY_KEY: ${{ secrets.GH_MAK }}131        with:132          source-directory: tests/unique-types-js133          destination-repository-name: 'lzadjsf/unique-types-js'134          commit-message: 'chore: regenerate types'135          target-branch: ${{ matrix.branch }}136137138      - name: Stop running containers139        if: always()                   # run this step always140        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
modified.github/workflows/dev-build-tests.ymldiffbeforeafterboth
--- a/.github/workflows/dev-build-tests.yml
+++ b/.github/workflows/dev-build-tests.yml
@@ -96,10 +96,12 @@
           node-version: 16
 
       - name: Run tests
+        working-directory: tests
         run: |
-          cd tests
           yarn install
           yarn add mochawesome
+          yarn polkadot-types
+          
           echo "Ready to start tests"
           node scripts/readyness.js
           NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
modifiedtests/scripts/readyness.jsdiffbeforeafterboth
--- a/tests/scripts/readyness.js
+++ b/tests/scripts/readyness.js
@@ -6,9 +6,9 @@
   await api.isReadyOrError;
 
   const head = (await api.rpc.chain.getHeader()).number.toNumber();
+  await api.disconnect();
   if(head < 1) throw Error('No block #1');
 
-  await api.disconnect();
 }
 
 const sleep = time => {