From 2640ccb20a40b4382712d1bb8adac4797f6d951d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Wed, 27 Sep 2023 14:42:12 +0200 Subject: [PATCH 1/5] chore(trading): change runner for mainnet compatible vega version (#4907) --- .github/workflows/cypress-run.yml | 2 +- .../src/integration/trading-deal-ticket-order.cy.ts | 7 ++++--- apps/trading-e2e/src/integration/trading-trades.cy.ts | 2 +- vegacapsule/genesis.tmpl | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cypress-run.yml b/.github/workflows/cypress-run.yml index 85a91b12d..fa4072662 100644 --- a/.github/workflows/cypress-run.yml +++ b/.github/workflows/cypress-run.yml @@ -19,7 +19,7 @@ jobs: matrix: project: ${{ fromJSON(inputs.projects) }} name: ${{ matrix.project }} - runs-on: self-hosted-runner + runs-on: mainnet-compatible-runner timeout-minutes: 120 steps: # Checks if skip cache was requested diff --git a/apps/trading-e2e/src/integration/trading-deal-ticket-order.cy.ts b/apps/trading-e2e/src/integration/trading-deal-ticket-order.cy.ts index d2bd1c0d6..ac6be028d 100644 --- a/apps/trading-e2e/src/integration/trading-deal-ticket-order.cy.ts +++ b/apps/trading-e2e/src/integration/trading-deal-ticket-order.cy.ts @@ -24,9 +24,7 @@ describe('deal ticker order validation', { tags: '@smoke' }, () => { beforeEach(() => { cy.mockTradingPage(); - cy.getByTestId('deal-ticket-fee-margin-required').within(() => { - cy.get('button').click(); - }); + cy.getByTestId('deal-ticket-fee-margin-required').click(); }); describe('limit order', () => { @@ -111,6 +109,7 @@ describe('deal ticker order validation', { tags: '@smoke' }, () => { 'Total margin available100.01 tDAI' ); }); + cy.getByTestId('deal-ticket-fee-margin-required').click(); }); it('must have current margin allocation', () => { @@ -120,6 +119,7 @@ describe('deal ticker order validation', { tags: '@smoke' }, () => { 'Current margin allocation' ); }); + cy.getByTestId('deal-ticket-fee-margin-required').click(); }); it('should open usage breakdown dialog when clicked on current margin allocation', () => { @@ -128,6 +128,7 @@ describe('deal ticker order validation', { tags: '@smoke' }, () => { }); cy.getByTestId('usage-breakdown').should('exist'); cy.getByTestId('dialog-close').click(); + cy.getByTestId('deal-ticket-fee-margin-required').click(); }); }); }); diff --git a/apps/trading-e2e/src/integration/trading-trades.cy.ts b/apps/trading-e2e/src/integration/trading-trades.cy.ts index 50ad89f99..47518fbca 100644 --- a/apps/trading-e2e/src/integration/trading-trades.cy.ts +++ b/apps/trading-e2e/src/integration/trading-trades.cy.ts @@ -86,8 +86,8 @@ describe('trades', { tags: '@smoke' }, () => { }); it('copy price to deal ticket form', () => { - cy.getByTestId('Order').click(); // 6005-THIS-007 + cy.getByTestId('order-type-Limit').click(); cy.get(colIdPrice).last().should('be.visible').click(); cy.getByTestId('order-price').should('have.value', '171.16898'); }); diff --git a/vegacapsule/genesis.tmpl b/vegacapsule/genesis.tmpl index c4a6e60e8..692bd7efc 100644 --- a/vegacapsule/genesis.tmpl +++ b/vegacapsule/genesis.tmpl @@ -195,7 +195,6 @@ "market.fee.factors.makerFee": "0.004", "market.liquidity.stakeToCcyVolume": "0.3", "market.liquidity.targetstake.triggering.ratio": "0.7", - "market.liquidity.providersFeeCalculationTimeStep": "5s", "network.checkpoint.timeElapsedBetweenCheckpoints": "10s", "reward.asset": "{{.GetVegaContractID "VEGA"}}", "reward.staking.delegation.competitionLevel": "3.1", From 7ac3a68ac9a7fe0a45017a7a610c71861ba05437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Wed, 27 Sep 2023 15:18:32 +0200 Subject: [PATCH 2/5] chore(trading): add possibility to manualy trigger console-test (#4899) --- .github/workflows/console-test-run.yml | 42 +++++++++++++++++++++----- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index 28211ac59..851e030fb 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -6,20 +6,28 @@ on: github-sha: required: true type: string + workflow_dispatch: + inputs: + console-test-branch: + type: choice + description: 'main: v0.72.14, develop: v0.73.0-preview7' + options: + - main + - develop jobs: run-tests: name: run-tests - runs-on: console-test + runs-on: 8-cores timeout-minutes: 20 steps: #---------------------------------------------- # check-out frontend-monorepo #---------------------------------------------- - - name: Checkout console test repo + - name: Checkout frontend-monorepo uses: actions/checkout@v3 with: - ref: ${{ inputs.github-sha }} + ref: ${{ inputs.github-sha || github.sha }} #---------------------------------------------- # cache node modules #---------------------------------------------- @@ -65,32 +73,42 @@ jobs: uses: actions/checkout@v3 with: repository: vegaprotocol/console-test + ref: ${{ inputs.console-test-branch }} path: './console-test' + + - name: Load console test envs + id: console-test-env + uses: falti/dotenv-action@v1.0.4 + with: + path: './console-test/.env.${{ inputs.console-test-branch }}' + export-variables: true + keys-case: upper + log-variables: true + #---------------------------------------------- # install dependencies if cache does not exist #---------------------------------------------- - name: Install dependencies working-directory: ./console-test - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- # install vega binaries #---------------------------------------------- - name: Install vega binaries working-directory: ./console-test - run: poetry run python -m vega_sim.tools.load_binaries --force + run: poetry run python -m vega_sim.tools.load_binaries --force --version ${{ env.VEGA_VERSION }} #---------------------------------------------- # install playwright #---------------------------------------------- - name: install playwright - run: poetry run playwright install + run: poetry run playwright install --with-deps chromium working-directory: ./console-test #---------------------------------------------- # run tests #---------------------------------------------- - name: Run tests working-directory: ./console-test - run: poetry run pytest -v -s --numprocesses 2 --dist loadfile --durations=20 + run: poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15 - name: Check files run: | ls -al . @@ -105,3 +123,13 @@ jobs: name: playwright-trace path: ./traces/ retention-days: 15 + #---------------------------------------------- + # ----- upload logs ----- + #---------------------------------------------- + - name: Upload worker logs + uses: actions/upload-artifact@v3 + if: always() + with: + name: worker-logs + path: ./logs/ + retention-days: 15 From b76102306938ab338edef6f234b6a759f3158c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Thu, 28 Sep 2023 11:25:44 +0200 Subject: [PATCH 3/5] chore(ci): add logic for choosing correct runner for cypress tests depending on base branch (#4918) --- .github/workflows/cypress-run.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cypress-run.yml b/.github/workflows/cypress-run.yml index fa4072662..c69ff6edd 100644 --- a/.github/workflows/cypress-run.yml +++ b/.github/workflows/cypress-run.yml @@ -13,13 +13,28 @@ on: type: string jobs: + runner-choice: + runs-on: ubuntu-latest + outputs: + runner: ${{ steps.step.outputs.runner }} + steps: + - name: Check branch + id: step + run: | + if [ ${{ github.base_ref }} == 'main' ]; then + echo "runner=mainnet-compatible-runner" >> $GITHUB_OUTPUT + else + echo "runner=self-hosted-runner" >> $GITHUB_OUTPUT + fi + e2e: strategy: fail-fast: false matrix: project: ${{ fromJSON(inputs.projects) }} name: ${{ matrix.project }} - runs-on: mainnet-compatible-runner + needs: runner-choice + runs-on: ${{ needs.runner-choice.outputs.runner }} timeout-minutes: 120 steps: # Checks if skip cache was requested From 7fe269fad699fbe8730f6af1011921ad230c5feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Thu, 28 Sep 2023 11:26:15 +0200 Subject: [PATCH 4/5] chore(ci): fix node version (main) (#4911) --- .github/workflows/console-test-run.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index 851e030fb..672a5f065 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -31,6 +31,12 @@ jobs: #---------------------------------------------- # cache node modules #---------------------------------------------- + - name: setup node + uses: actions/setup-node@v3 + with: + node-version: '16' + cache: yarn + - name: Cache node modules id: cache uses: actions/cache@v3 From e2a72cb39501de29ad83cbe8e8efeb3108db6ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Thu, 28 Sep 2023 14:01:36 +0200 Subject: [PATCH 5/5] chore(ci): separate lint pr (main) (#4917) --- .github/workflows/ci-cd-trigger.yml | 8 -------- .github/workflows/lint-pr.yml | 20 +++++++++----------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index 2fb441e24..ac5f65f8b 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -10,7 +10,6 @@ on: - opened - ready_for_review - reopened - - edited - synchronize jobs: node-modules: @@ -42,13 +41,6 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn install --pure-lockfile - lint-pr-title: - needs: node-modules - if: ${{ github.event_name == 'pull_request' }} - name: Verify PR title - uses: ./.github/workflows/lint-pr.yml - secrets: inherit - lint-format: timeout-minutes: 20 needs: node-modules diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 9b1666a42..344a607ac 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -2,7 +2,10 @@ name: Verify PR title on: - workflow_call: + pull_request: + types: + - opened + - edited jobs: lint_pr: @@ -11,21 +14,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup node uses: actions/setup-node@v3 with: - node-version-file: '.nvmrc' - # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions - cache: yarn + node-version: 16 - - name: Cache node modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }} + - name: Install dependencies + run: | + rm package.json + npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx - name: Check PR title run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js