d47d754ac9
* test: initial commit * test: commit * test: extra tests and references added also new tag 0.55.0 for builds * test: lint * test: back to 0.54 for capsule cypress until tests fixed * test: skip two tests since wallet name no longer shown soon to be fixed * test: couple more tests to fulfill ACs * test: lint * test: more tests * test: lint * test: extra check within test * test: lint * test: minor * test: improve test flake and skip test bugs outstanding * test: lint and increase epoch length by second * test: more tests * test: lint * test: lint * test: lint * test: teardown functionality * test: lint * test: epoch speed up and network restart stuff * test: lint * test: change epoch duration * test: timing tweaks due to failures in CI * test: lint * test: more timing tweaks * test: lint * test: timing tweak * test: lint * test: lint * test: config changes
157 lines
4.5 KiB
YAML
157 lines
4.5 KiB
YAML
name: Capsule tests -- manual trigger
|
|
|
|
# This workflow runs the frontend tests against chosen branch
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
project:
|
|
description: 'Project'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- explorer-e2e
|
|
- console-lite-e2e
|
|
- stats-e2e
|
|
- token-e2e
|
|
- trading-e2e
|
|
includeFlows:
|
|
description: 'Include long flows (if any)?'
|
|
required: true
|
|
type: boolean
|
|
default: true
|
|
|
|
jobs:
|
|
manual:
|
|
name: Run capsule tests -- manual trigger
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GO111MODULE: 'on'
|
|
GOPROXY: ${{ secrets.GO_PROXY }}
|
|
steps:
|
|
#######
|
|
## Setup langs
|
|
#######
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
id: go
|
|
with:
|
|
go-version: 1.19
|
|
- name: Set up Node 16
|
|
uses: actions/setup-node@v2
|
|
id: npm
|
|
with:
|
|
node-version: 16
|
|
|
|
#######
|
|
## Checkout capsule
|
|
#######
|
|
|
|
# Checkout front ends
|
|
- name: Checkout frontend mono repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
fetch-depth: 0
|
|
path: './frontend-monorepo'
|
|
|
|
# Checkout capsule to build local network
|
|
- name: Checkout capsule
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: vegaprotocol/vegacapsule
|
|
ref: main
|
|
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
path: './capsule'
|
|
|
|
#######
|
|
## Build binaries
|
|
#######
|
|
- name: Build capsule
|
|
run: go install
|
|
working-directory: capsule
|
|
|
|
- name: Set GOBIN
|
|
run: echo GOBIN=$(go env GOPATH)/bin >> $GITHUB_ENV
|
|
|
|
- name: Checkout Vega
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: vegaprotocol/vega
|
|
ref: v0.55.0
|
|
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
path: './vega'
|
|
|
|
- name: Install Vega binaries
|
|
run: go install -v ./cmd/vega
|
|
working-directory: vega
|
|
|
|
- name: Install Vega wallet binaries
|
|
run: go install ./cmd/vegawallet
|
|
working-directory: vega
|
|
|
|
- name: Install date-node binaries
|
|
run: go install ./cmd/data-node
|
|
working-directory: vega
|
|
|
|
######
|
|
## Start capsule
|
|
######
|
|
- name: Login to docker
|
|
run: echo -n ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} | docker login https://ghcr.io -u vega-ci-bot --password-stdin
|
|
|
|
- name: Start nomad
|
|
run: vegacapsule nomad &
|
|
|
|
- name: Bootstrap network
|
|
run: vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl --force
|
|
working-directory: capsule
|
|
|
|
######
|
|
## Setup a Vega wallet for our user
|
|
######
|
|
- name: Create passphrase
|
|
run: echo "${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}" > ./passphrase
|
|
- name: Create recovery
|
|
run: echo "${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}" > ./recovery
|
|
|
|
- name: Initialize wallet
|
|
run: vegawallet init -f --home ~/.vegacapsule/testnet/wallet
|
|
- name: Import wallet
|
|
run: vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
|
- name: Create public key 2
|
|
run: vegawallet key generate -w UI_Trading_Test -p ./passphrase --home ~/.vegacapsule/testnet/wallet
|
|
- name: Start service
|
|
run: vegawallet service run --network DV --automatic-consent --home ~/.vegacapsule/testnet/wallet &
|
|
|
|
######
|
|
## Run some tests
|
|
######
|
|
|
|
- name: Install root dependencies
|
|
run: yarn install
|
|
working-directory: frontend-monorepo
|
|
|
|
- name: Run Cypress tests
|
|
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
working-directory: frontend-monorepo
|
|
env:
|
|
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
|
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
|
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
|
CYPRESS_INCLUDE_FLOWS: ${{ github.event.inputs.includeFlows }}
|
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
|
|
|
######
|
|
## Upload logs
|
|
######
|
|
|
|
- name: Logs
|
|
if: ${{ always() }}
|
|
run: vegacapsule network logs > vega-capsule-logs.txt
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: logs
|
|
path: ./vega-capsule-logs.txt
|