From 8b19572dc94865968a30327c7910a8375308ef5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20M=C5=82odzikowski?= Date: Fri, 15 Sep 2023 17:36:08 +0200 Subject: [PATCH 1/4] feat(ci): proper run --- .github/workflows/publish-dist.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 07d65c602..8ac8886cf 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -155,10 +155,10 @@ jobs: - name: Sanity check docker image run: | echo "Check ipfs-hash" - docker run --rm --entrypoint /bin/sh ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local cat /ipfs-hash - docker run --rm --entrypoint /bin/sh ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local cat /ipfs-hash > ${{ matrix.app }}-ipfs-hash + docker run --rm --entrypoint /bin/sh ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local -c 'cat /ipfs-hash' + docker run --rm --entrypoint /bin/sh ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local -c 'cat /ipfs-hash' > ${{ matrix.app }}-ipfs-hash echo "List html directory" - docker run --rm --entrypoint /bin/sh ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local sh -c 'apk add --update tree; tree /usr/share/nginx/html' + docker run --rm --entrypoint /bin/sh ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local -c 'apk add --update tree; tree /usr/share/nginx/html' - name: Publish dist as docker image (ghcr) uses: docker/build-push-action@v3 From f3e2fe746d19c9149f6b3f8a7c44406772820507 Mon Sep 17 00:00:00 2001 From: daro-maj <119658839+daro-maj@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:40:35 +0200 Subject: [PATCH 2/4] test(trading): fix test for release v0.21.2 (#4806) --- .github/workflows/console-test-run.yml | 8 ++++++-- .../src/integration/trading-deal-ticket-order.cy.ts | 7 ++++--- apps/trading-e2e/src/integration/trading-trades.cy.ts | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index 28211ac59..66984ade1 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -1,5 +1,8 @@ name: (CI) Console tests +env: + VEGA_VERSION: v0.72.14 + on: workflow_call: inputs: @@ -11,7 +14,7 @@ jobs: run-tests: name: run-tests runs-on: console-test - timeout-minutes: 20 + timeout-minutes: 40 steps: #---------------------------------------------- # check-out frontend-monorepo @@ -78,7 +81,8 @@ jobs: #---------------------------------------------- - name: Install vega binaries working-directory: ./console-test - run: poetry run python -m vega_sim.tools.load_binaries --force + if: steps.vega_binaries_cache.outputs.cache-hit != 'true' + run: poetry run python -m vega_sim.tools.load_binaries --force --version $VEGA_VERSION #---------------------------------------------- # install playwright #---------------------------------------------- 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'); }); From 62f368da10a72de04b6e5226a9c6a75b986fd12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Mon, 18 Sep 2023 11:28:15 +0200 Subject: [PATCH 3/4] chore(trading): cache console test vega binaries (#4752) --- .github/workflows/console-test-run.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index 66984ade1..84a27447c 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -70,14 +70,29 @@ jobs: repository: vegaprotocol/console-test path: './console-test' #---------------------------------------------- - # install dependencies if cache does not exist + # install dependencies #---------------------------------------------- - 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 + # find vega binaries path + #---------------------------------------------- + - name: Find vega binaries path + id: vega_bin_path + working-directory: ./console-test + run: echo path=$(poetry run python -c "import vega_sim; print(vega_sim.vega_bin_path)") >> $GITHUB_OUTPUT + #---------------------------------------------- + # vega binaries cache + #---------------------------------------------- + - name: Vega binaries cache + uses: actions/cache@v3 + id: vega_binaries_cache + with: + path: ${{ steps.vega_bin_path.outputs.path }} + key: ${{ runner.os }}-vega-binaries-${{ env.VEGA_VERSION }} + #---------------------------------------------- + # install vega binaries #---------------------------------------------- - name: Install vega binaries working-directory: ./console-test @@ -87,7 +102,7 @@ jobs: # install playwright #---------------------------------------------- - name: install playwright - run: poetry run playwright install + run: poetry run playwright install --with-deps chromium working-directory: ./console-test #---------------------------------------------- # run tests From a6672d213f9b71680154ff710a910c2a812c0ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20M=C5=82odzikowski?= Date: Mon, 18 Sep 2023 13:17:37 +0200 Subject: [PATCH 4/4] fix(ci): provide better endpoint --- docker/entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 0bc9d09e0..c0ccf08a9 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,11 +1,14 @@ #!/bin/sh -daemon="${1:-nginx}" +entrypoint="${1:-nginx}" -if [[ "$daemon" = "nginx" ]]; then +if [[ "$entrypoint" = "nginx" ]]; then nginx -g 'daemon off;' -elif [[ "$daemon" = "ipfs" ]]; then +elif [[ "$entrypoint" = "ipfs" ]]; then ipfs config profile apply server ipfs config --json Addresses.Gateway '"/ip4/127.0.0.1/tcp/80"' ipfs daemon +elif [[ "-c" ]]; then + shift + /bin/sh -c "$@" fi