From 94c93ce790dcab24bde948b94b4f4dc75c4e0bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Mon, 14 Nov 2022 16:03:57 +0100 Subject: [PATCH] test: use vegawallet dummy in e2e test workflows (#2055) * chore: use vegawallet-dummy in workflows * chore: fix * chore: fix * chore: add info about dummy in readme --- .../actions/install-vega-binaries/action.yml | 19 ++++++++----------- .github/actions/setup-vegawallet/action.yml | 14 ++++++++------ .../workflows/cypress-console-lite-e2e.yml | 1 - .github/workflows/cypress-explorer-e2e.yml | 1 - .github/workflows/cypress-token-e2e.yml | 1 - .github/workflows/cypress-trading-e2e.yml | 1 - README.md | 3 ++- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/actions/install-vega-binaries/action.yml b/.github/actions/install-vega-binaries/action.yml index ee28a409d..c88ae7660 100644 --- a/.github/actions/install-vega-binaries/action.yml +++ b/.github/actions/install-vega-binaries/action.yml @@ -11,21 +11,18 @@ runs: using: 'composite' steps: - name: Install Vega binaries - if: ${{ inputs.all }} shell: bash run: | wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/vega-linux-amd64.zip' -q unzip vega-linux-amd64.zip -d ${{ inputs.gobin }} - - name: Install date-node binaries - if: ${{ inputs.all }} - shell: bash - run: | - wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/data-node-linux-amd64.zip' -q - unzip data-node-linux-amd64.zip -d ${{ inputs.gobin }} + - name: Checkout vegawallet-dummy + uses: actions/checkout@v3 + with: + repository: 'vegaprotocol/vegawallet-dummy' + path: './dummy' - - name: Install Vega wallet binaries + - name: Install vegawallet-dummy binaries shell: bash - run: | - wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/vegawallet-linux-amd64.zip' -q - unzip vegawallet-linux-amd64.zip -d ${{ inputs.gobin }} + run: go install + working-directory: ./dummy diff --git a/.github/actions/setup-vegawallet/action.yml b/.github/actions/setup-vegawallet/action.yml index 5792248a8..7e182f3c3 100644 --- a/.github/actions/setup-vegawallet/action.yml +++ b/.github/actions/setup-vegawallet/action.yml @@ -19,27 +19,29 @@ runs: - name: Initialize wallet shell: bash - run: vegawallet init -f --home ~/.vegacapsule/testnet/wallet + run: vega wallet init -f --home ~/.vegacapsule/testnet/wallet - name: Import wallet shell: bash - run: vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet + if: ${{ inputs.capsule=='false' }} + run: vega wallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet - name: Create public key 2 shell: bash - run: vegawallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet + if: ${{ inputs.capsule=='false' }} + run: vega wallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet - name: Import network shell: bash if: ${{ inputs.capsule=='false' }} - run: vegawallet network import --from-url="https://raw.githubusercontent.com/vegaprotocol/networks-internal/master/stagnet3/stagnet3.toml" --force --home ~/.vegacapsule/testnet/wallet + run: vega wallet network import --from-url="https://raw.githubusercontent.com/vegaprotocol/networks-internal/master/stagnet3/stagnet3.toml" --force --home ~/.vegacapsule/testnet/wallet - name: Start service using fairground network shell: bash if: ${{ inputs.capsule=='false' }} - run: vegawallet service run --network stagnet3 --automatic-consent --no-version-check --home ~/.vegacapsule/testnet/wallet & + run: vegawallet-dummy service run --network stagnet3 --wallet UI_Trading_Test --passphrase-file ./passphrase --home ~/.vegacapsule/testnet/wallet & - name: Start service using capsule network shell: bash if: ${{ inputs.capsule=='true' }} - run: vegawallet service run --network DV --automatic-consent --home ~/.vegacapsule/testnet/wallet & + run: vegawallet-dummy service run --network DV --wallet capsule_wallet --passphrase-file ./passphrase --home ~/.vegacapsule/testnet/wallet & diff --git a/.github/workflows/cypress-console-lite-e2e.yml b/.github/workflows/cypress-console-lite-e2e.yml index 160eb7a19..2822c0d76 100644 --- a/.github/workflows/cypress-console-lite-e2e.yml +++ b/.github/workflows/cypress-console-lite-e2e.yml @@ -58,7 +58,6 @@ jobs: - name: Install Vega binaries uses: ./frontend-monorepo/.github/actions/install-vega-binaries with: - all: false version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} diff --git a/.github/workflows/cypress-explorer-e2e.yml b/.github/workflows/cypress-explorer-e2e.yml index 162c04829..c2974851b 100644 --- a/.github/workflows/cypress-explorer-e2e.yml +++ b/.github/workflows/cypress-explorer-e2e.yml @@ -67,7 +67,6 @@ jobs: - name: Install Vega binaries uses: ./frontend-monorepo/.github/actions/install-vega-binaries with: - all: true version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} diff --git a/.github/workflows/cypress-token-e2e.yml b/.github/workflows/cypress-token-e2e.yml index 8a1e87ad9..67385b622 100644 --- a/.github/workflows/cypress-token-e2e.yml +++ b/.github/workflows/cypress-token-e2e.yml @@ -63,7 +63,6 @@ jobs: - name: Install Vega binaries uses: ./frontend-monorepo/.github/actions/install-vega-binaries with: - all: true version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} diff --git a/.github/workflows/cypress-trading-e2e.yml b/.github/workflows/cypress-trading-e2e.yml index b75a6b2a7..a58760423 100644 --- a/.github/workflows/cypress-trading-e2e.yml +++ b/.github/workflows/cypress-trading-e2e.yml @@ -59,7 +59,6 @@ jobs: - name: Install Vega binaries uses: ./frontend-monorepo/.github/actions/install-vega-binaries with: - all: false version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} diff --git a/README.md b/README.md index 43166f92f..eef16773f 100644 --- a/README.md +++ b/README.md @@ -86,13 +86,14 @@ Run `yarn nx run -e2e:e2e` to execute the e2e tests with [cypress](https Run `nx test my-app` to execute the unit tests with [Jest](https://jestjs.io), or `nx affected:test` to execute just unit tests affected by a change. You can also use `--watch` with these test to run jest in watch mode, see [Jest executor](https://nx.dev/packages/jest/executors/jest) for all CLI flags. -#### Trading app E2E tests +### Using wallet To run tests locally using your own wallets you can add the following environment variables to `cypress.json` 1. Change `TRADING_TEST_VEGA_WALLET_NAME` to your Vega wallet name 2. Add `TRADING_TEST_VEGA_WALLET_PASSPHRASE` as your wallet passphrase 3. Add `ETH_WALLET_MNEMONIC` as your Ethereum wallet mnemonic +4. Use [vegawallet-dummy](https://github.com/vegaprotocol/vegawallet-dummy) to avoid being prompted in CLI during test execution. ### Formatting