diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index da43d1e1a..01ba8efea 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -1,8 +1,5 @@ name: (CI) Console tests -env: - VEGA_VERSION: v0.72.14 - on: workflow_call: inputs: @@ -19,9 +16,9 @@ on: - develop jobs: - run-tests: - name: run-tests - runs-on: 8-cores + create-docker-image: + name: Create docker image for console-test + runs-on: ubuntu-22.04 timeout-minutes: 20 steps: #---------------------------------------------- @@ -58,23 +55,68 @@ jobs: #---------------------------------------------- # build trading #---------------------------------------------- - - name: Build affected spec + - name: Build trading app run: | yarn env-cmd -f ./apps/trading/.env.stagnet1 yarn nx export trading + DIST_LOCATION=dist/apps/trading/exported + mv $DIST_LOCATION dist-result + tree dist-result + #---------------------------------------------- - # run trading server + # export trading app docker image #---------------------------------------------- - - name: Run trading server + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and export to local Docker + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + file: docker/node-outside-docker.Dockerfile + load: true + build-args: | + APP=trading + ENV_NAME=stagnet1 + tags: ci/trading:local + outputs: type=docker,dest=/tmp/console-image.tar + + - name: Verify docker image created run: | - docker run -d -p 80:4200 -v $PWD/docker/nginx.conf:/etc/nginx/conf.d/default.conf -v $PWD/dist/apps/trading/exported:/usr/share/nginx/html nginx:1.23-alpine@sha256:6318314189b40e73145a48060bff4783a116c34cc7241532d0d94198fb2c9629 - sleep 5 - docker ps + echo ${{ steps.docker_build.outputs.digest }} + echo ${{ steps.docker_build.outputs.imageid }} + + - name: Upload docker image for console-test usage + uses: actions/upload-artifact@v3 + with: + name: console-image + path: /tmp/console-image.tar + + run-tests: + name: run-tests + runs-on: 8-cores + needs: create-docker-image + timeout-minutes: 20 + steps: #---------------------------------------------- - # check if container persists between runs + # load docker image #---------------------------------------------- - - name: Check server + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Download docker image from previous job + uses: actions/download-artifact@v3 + with: + name: console-image + path: /tmp + + - name: Load Docker image run: | - docker ps + docker load --input /tmp/console-image.tar + docker image ls -a + #---------------------------------------------- # check-out tests repo #---------------------------------------------- @@ -83,61 +125,54 @@ jobs: 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 }}' + path: '.env.${{ inputs.console-test-branch }}' export-variables: true keys-case: upper log-variables: true #---------------------------------------------- - # install dependencies + # ----- Setup python ----- + #---------------------------------------------- + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + virtualenvs-path: .venv + + #---------------------------------------------- + # install python dependencies #---------------------------------------------- - name: Install dependencies - working-directory: ./console-test run: poetry install --no-interaction --no-root #---------------------------------------------- - # 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 + # install vega binaries #---------------------------------------------- - name: Install vega binaries - working-directory: ./console-test 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 --with-deps chromium - working-directory: ./console-test #---------------------------------------------- # run tests #---------------------------------------------- - name: Run tests - working-directory: ./console-test - run: poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15 - - name: Check files - run: | - ls -al . - ls -al console-test + run: CONSOLE_IMAGE_NAME=ci/trading:local poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15 + #---------------------------------------------- # upload traces #---------------------------------------------- diff --git a/apps/governance-e2e/src/integration/view/proposal.cy.ts b/apps/governance-e2e/src/integration/view/proposal.cy.ts index fcc4694df..efac2b02e 100644 --- a/apps/governance-e2e/src/integration/view/proposal.cy.ts +++ b/apps/governance-e2e/src/integration/view/proposal.cy.ts @@ -74,7 +74,7 @@ context( }); it('should be able to see a working link for - find out more about Vega governance', function () { - // 3001-VOTE-001 3002-PROP-001 + // 3001-VOTE-001 // 3002-PROP-001 cy.getByTestId(proposalDocumentationLink) .should('be.visible') .and('have.text', 'Find out more about Vega governance') diff --git a/libs/wallet/src/connect-dialog/connect-dialog.tsx b/libs/wallet/src/connect-dialog/connect-dialog.tsx index 4073006f4..d24f16612 100644 --- a/libs/wallet/src/connect-dialog/connect-dialog.tsx +++ b/libs/wallet/src/connect-dialog/connect-dialog.tsx @@ -15,6 +15,7 @@ import { useCallback, useState } from 'react'; import type { WalletClientError } from '@vegaprotocol/wallet-client'; import { t } from '@vegaprotocol/i18n'; import type { Connectors, VegaConnector } from '../connectors'; +import { DEFAULT_SNAP_VERSION } from '../connectors'; import { DEFAULT_SNAP_ID, InjectedConnector, @@ -352,7 +353,9 @@ const ConnectorList = ({ } onClick={() => { - requestSnap(DEFAULT_SNAP_ID); + requestSnap(DEFAULT_SNAP_ID, { + version: DEFAULT_SNAP_VERSION, + }); }} /> {snapStatus === SnapStatus.NOT_SUPPORTED ? ( diff --git a/libs/wallet/src/connectors/snap-connector.ts b/libs/wallet/src/connectors/snap-connector.ts index 861967a09..2a77da97a 100644 --- a/libs/wallet/src/connectors/snap-connector.ts +++ b/libs/wallet/src/connectors/snap-connector.ts @@ -41,6 +41,7 @@ const ethereumRequest = (args: RequestArguments): Promise => { export const LOCAL_SNAP_ID = 'local:http://localhost:8080'; export const DEFAULT_SNAP_ID = 'npm:@vegaprotocol/snap'; +export const DEFAULT_SNAP_VERSION = '0.2.0'; type GetSnapsResponse = Record;