From 61e74509064cddf313b47576072f5579ccb72d7e Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 12 Jul 2023 12:06:48 +0100 Subject: [PATCH] feat(trading): run console-test on CICD (#4271) --- .github/workflows/ci-cd-trigger.yml | 8 ++++ .github/workflows/console-test-run.yml | 59 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/console-test-run.yml diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index fb318b68e..935d233d8 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -277,6 +277,14 @@ jobs: * trading: ${{ needs.lint-test-build.outputs.preview_trading }} * tools: ${{ needs.lint-test-build.outputs.preview_tools }} + console-test: + needs: dist-check + name: '(CI) console-test' + uses: ./.github/workflows/console-test-run.yml + secrets: inherit + with: + github-sha: ${{ github.sha }} + # Report single result at the end, to avoid mess with required checks in PR cypress-check: name: '(CI) cypress - check' diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml new file mode 100644 index 000000000..da259ebaf --- /dev/null +++ b/.github/workflows/console-test-run.yml @@ -0,0 +1,59 @@ +name: console-test-run +on: + workflow_call: + inputs: + github-sha: + required: true + type: string +jobs: + console-test: + timeout-minutes: 5 + runs-on: self-hosted-runner + steps: + - name: Checkout console test repo + uses: actions/checkout@v3 + with: + repository: vegaprotocol/console-test + path: './console-test' + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10.11' + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Install dependencies + run: | + poetry install --no-root + working-directory: ./console-test + + - name: load Binaries + run: | + poetry run python -m vega_sim.tools.load_binaries + working-directory: ./console-test + + - name: pull console + run: | + poetry run docker pull ghcr.io/vegaprotocol/frontend/trading:${{ inputs.github-sha }} + + - name: Update container_name in config.py + run: | + sed -i "s/container_name = \".*\"/container_name = \"vegaprotocol\/frontend\/trading:${{ inputs.github-sha }}\"/g" config.py + + - name: install playwright + run: poetry run playwright install + working-directory: ./console-test + + - name: run tests + run: poetry run pytest --numprocesses auto + working-directory: ./console-test + + - name: Upload Playwright Trace + uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-trace + path: ./traces/ + retention-days: 15