From 2469ee725ca59c2308967c26c77389d3efb874b0 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 06 Sep 2022 12:14:41 +0000 Subject: [PATCH] correct and enable tests/scripts/readyness.js --- --- a/.github/workflows/autogen-js-types.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: yarn autogetn JS types - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - autogen_js_types: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] - 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: - - network: "opal" - features: "opal-runtime" - branch: "opal-testnet" - - network: "quartz" - features: "quartz-runtime" - branch: "quartz-mainnet" - - network: "unique" - features: "unique-runtime" - branch: "master" - - 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-dev.j2 - output_file: .docker/docker-compose.${{ matrix.network }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - - - - name: Show build configuration - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - - name: Wait untill node-dev started. - run: sleep 600s - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Generate - working-directory: tests - run: | - yarn install - yarn polkadot-types - - - name: Checkout repo UniqueNetwork/unique-types-js - uses: actions/checkout@v3 - with: - repository: 'UniqueNetwork/unique-types-js' -# ssh-key: ${{ secrets.GH_PAT }} - path: 'tests/unique-types-js' -# ref: 'QA-65_maxandreev' - - - name: Copy files - working-directory: tests - run: | - rsync -ar --exclude .gitignore src/interfaces/ unique-types-js - for file in unique-types-js/augment-* unique-types-js/**/types.ts unique-types-js/registry.ts; do - sed -i '1s;^;//@ts-nocheck\n;' $file - done - - - name: Enumerate files after generation - working-directory: tests/unique-types-js - run: | - ls -la - - - name: Enumerate files after generation - working-directory: tests/ - run: | - ls -la - - - name: Upload JS types to repo - working-directory: tests/unique-types-js - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git add . - git commit -m "chore: regenerate types" - - - name: Pushes to another repository - id: push_directory - uses: cpina/github-action-push-to-another-repository@main - env: - SSH_DEPLOY_KEY: ${{ secrets.GH_MAK }} - with: - source-directory: tests/unique-types-js - destination-repository-name: 'lzadjsf/unique-types-js' - commit-message: 'chore: regenerate types' - target-branch: ${{ matrix.branch }} - - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down --- 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} --- 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 => { -- gitstuff