Merge pull request #4993 from vegaprotocol/chore/update-develop-with-main

chore(ci,governance): update develop with latest main changes
This commit is contained in:
Radosław Szpiech 2023-10-06 13:52:19 +02:00 committed by GitHub
commit 349c790ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 46 deletions

View File

@ -1,8 +1,5 @@
name: (CI) Console tests name: (CI) Console tests
env:
VEGA_VERSION: v0.72.14
on: on:
workflow_call: workflow_call:
inputs: inputs:
@ -19,9 +16,9 @@ on:
- develop - develop
jobs: jobs:
run-tests: create-docker-image:
name: run-tests name: Create docker image for console-test
runs-on: 8-cores runs-on: ubuntu-22.04
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
#---------------------------------------------- #----------------------------------------------
@ -58,23 +55,68 @@ jobs:
#---------------------------------------------- #----------------------------------------------
# build trading # build trading
#---------------------------------------------- #----------------------------------------------
- name: Build affected spec - name: Build trading app
run: | run: |
yarn env-cmd -f ./apps/trading/.env.stagnet1 yarn nx export trading 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: | 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 echo ${{ steps.docker_build.outputs.digest }}
sleep 5 echo ${{ steps.docker_build.outputs.imageid }}
docker ps
- 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: | run: |
docker ps docker load --input /tmp/console-image.tar
docker image ls -a
#---------------------------------------------- #----------------------------------------------
# check-out tests repo # check-out tests repo
#---------------------------------------------- #----------------------------------------------
@ -83,61 +125,54 @@ jobs:
with: with:
repository: vegaprotocol/console-test repository: vegaprotocol/console-test
ref: ${{ inputs.console-test-branch }} ref: ${{ inputs.console-test-branch }}
path: './console-test'
- name: Load console test envs - name: Load console test envs
id: console-test-env id: console-test-env
uses: falti/dotenv-action@v1.0.4 uses: falti/dotenv-action@v1.0.4
with: with:
path: './console-test/.env.${{ inputs.console-test-branch }}' path: '.env.${{ inputs.console-test-branch }}'
export-variables: true export-variables: true
keys-case: upper keys-case: upper
log-variables: true 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 - name: Install dependencies
working-directory: ./console-test
run: poetry install --no-interaction --no-root run: poetry install --no-interaction --no-root
#---------------------------------------------- #----------------------------------------------
# find vega binaries path # install vega binaries
#----------------------------------------------
- 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 - name: Install vega binaries
working-directory: ./console-test
run: poetry run python -m vega_sim.tools.load_binaries --force --version ${{ env.VEGA_VERSION }} run: poetry run python -m vega_sim.tools.load_binaries --force --version ${{ env.VEGA_VERSION }}
#---------------------------------------------- #----------------------------------------------
# install playwright # install playwright
#---------------------------------------------- #----------------------------------------------
- name: install playwright - name: install playwright
run: poetry run playwright install --with-deps chromium run: poetry run playwright install --with-deps chromium
working-directory: ./console-test
#---------------------------------------------- #----------------------------------------------
# run tests # run tests
#---------------------------------------------- #----------------------------------------------
- name: Run tests - name: Run tests
working-directory: ./console-test run: CONSOLE_IMAGE_NAME=ci/trading:local poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15
run: poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15
- name: Check files
run: |
ls -al .
ls -al console-test
#---------------------------------------------- #----------------------------------------------
# upload traces # upload traces
#---------------------------------------------- #----------------------------------------------

View File

@ -74,7 +74,7 @@ context(
}); });
it('should be able to see a working link for - find out more about Vega governance', function () { 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) cy.getByTestId(proposalDocumentationLink)
.should('be.visible') .should('be.visible')
.and('have.text', 'Find out more about Vega governance') .and('have.text', 'Find out more about Vega governance')

View File

@ -15,6 +15,7 @@ import { useCallback, useState } from 'react';
import type { WalletClientError } from '@vegaprotocol/wallet-client'; import type { WalletClientError } from '@vegaprotocol/wallet-client';
import { t } from '@vegaprotocol/i18n'; import { t } from '@vegaprotocol/i18n';
import type { Connectors, VegaConnector } from '../connectors'; import type { Connectors, VegaConnector } from '../connectors';
import { DEFAULT_SNAP_VERSION } from '../connectors';
import { import {
DEFAULT_SNAP_ID, DEFAULT_SNAP_ID,
InjectedConnector, InjectedConnector,
@ -352,7 +353,9 @@ const ConnectorList = ({
</> </>
} }
onClick={() => { onClick={() => {
requestSnap(DEFAULT_SNAP_ID); requestSnap(DEFAULT_SNAP_ID, {
version: DEFAULT_SNAP_VERSION,
});
}} }}
/> />
{snapStatus === SnapStatus.NOT_SUPPORTED ? ( {snapStatus === SnapStatus.NOT_SUPPORTED ? (

View File

@ -41,6 +41,7 @@ const ethereumRequest = <T>(args: RequestArguments): Promise<T> => {
export const LOCAL_SNAP_ID = 'local:http://localhost:8080'; export const LOCAL_SNAP_ID = 'local:http://localhost:8080';
export const DEFAULT_SNAP_ID = 'npm:@vegaprotocol/snap'; export const DEFAULT_SNAP_ID = 'npm:@vegaprotocol/snap';
export const DEFAULT_SNAP_VERSION = '0.2.0';
type GetSnapsResponse = Record<string, Snap>; type GetSnapsResponse = Record<string, Snap>;