Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: run e2e tests on devnet #115

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches: [main]
pull_request:
branches: [main]
types:
- labeled
- synchronize
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
Expand All @@ -17,6 +20,15 @@ on:
options:
- local
- emerynet
- devnet
gov1_mnemonic:
description: 'Mnemonic for gov1 wallet'
required: false
type: string
gov2_mnemonic:
description: 'Mnemonic for gov2 wallet'
required: false
type: string

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
Expand All @@ -32,15 +44,18 @@ jobs:
id-token: 'write'

env:
IS_EMERYNET_TEST: ${{ github.event_name == 'schedule' || inputs.network == 'emerynet' }}
NETWORK: ${{ inputs.network || contains(github.event.pull_request.labels.*.name, 'emerynet') && 'emerynet' || contains(github.event.pull_request.labels.*.name, 'devnet') && 'devnet' || github.event_name == 'schedule' && 'emerynet' || 'local' }}

steps:
- name: Print network name
run: echo "${{ env.NETWORK }}"

- name: Checkout
uses: actions/checkout@v3

- name: 'GCP auth'
uses: 'google-github-actions/auth@v2'
if: ${{ env.IS_EMERYNET_TEST == 'true' }}
if: ${{ env.NETWORK != 'local' }}
with:
project_id: 'simulationlab'
workload_identity_provider: 'projects/60745596728/locations/global/workloadIdentityPools/github/providers/dapp-econ-gov'
Expand All @@ -50,8 +65,8 @@ jobs:
docker compose -f tests/e2e/docker-compose.yml --profile $SYNPRESS_PROFILE up --build --exit-code-from synpress
env:
# conditionals based on github event
SYNPRESS_PROFILE: ${{ env.IS_EMERYNET_TEST == 'true' && 'daily-tests' || 'synpress' }}
CYPRESS_AGORIC_NET: ${{ env.IS_EMERYNET_TEST == 'true' && 'emerynet' || 'local' }}
SYNPRESS_PROFILE: ${{ env.NETWORK != 'local' && 'daily-tests' || 'synpress' }}
CYPRESS_AGORIC_NET: ${{ env.NETWORK }}
# for docker-compose.yml
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
Expand All @@ -62,8 +77,8 @@ jobs:
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GOV1_PHRASE: ${{ secrets.GOV1_PHRASE }}
GOV2_PHRASE: ${{ secrets.GOV2_PHRASE }}
GOV1_PHRASE: ${{ inputs.gov1_mnemonic || secrets.GOV1_PHRASE }}
GOV2_PHRASE: ${{ inputs.gov2_mnemonic || secrets.GOV2_PHRASE }}
# cypress dashboard
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
Expand All @@ -73,7 +88,7 @@ jobs:

- name: Archive e2e artifacts locally
uses: actions/upload-artifact@v3
if: ${{ env.IS_EMERYNET_TEST == 'false' && !cancelled()}}
if: ${{ env.NETWORK == 'local' && !cancelled()}}
with:
name: e2e-artifacts
path: |
Expand All @@ -83,14 +98,14 @@ jobs:

- name: Archive e2e artifacts to GCS
uses: google-github-actions/upload-cloud-storage@v2
if: ${{ env.IS_EMERYNET_TEST == 'true' && !cancelled() }}
if: ${{ env.NETWORK != 'local' && !cancelled() }}
with:
path: 'tests/e2e/docker'
destination: 'github-artifacts/${{ github.repository }}/${{ github.run_id }}/${{ github.event.repository.updated_at }}'
continue-on-error: true

- name: Log Path to GCS Artifacts
if: ${{ env.IS_EMERYNET_TEST == 'true' && !cancelled() }}
if: ${{ env.NETWORK != 'local' && !cancelled() }}
run: echo "https://console.cloud.google.com/storage/browser/github-artifacts/${{ github.repository }}/${{ github.run_id }}/${{ github.event.repository.updated_at }}/docker/videos"

- name: Notify About Failure
Expand Down
30 changes: 18 additions & 12 deletions tests/e2e/specs/proposal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@ describe('Make Proposal Tests', () => {
cy.visit('/');
});
cy.acceptAccess();
cy.origin('https://wallet.agoric.app/', () => {
cy.visit('/wallet/');

cy.get('input.PrivateSwitchBase-input').click();
cy.contains('Proceed').click();

cy.get('button[aria-label="Settings"]').click();

cy.get('#demo-simple-select').click();
cy.get('li[data-value="testnet"]').click();
cy.contains('button', 'Connect').click();
});
cy.origin(
'https://wallet.agoric.app/',
{ args: { networkPhrases } },
({ networkPhrases }) => {
cy.visit('/wallet/');

cy.get('input.PrivateSwitchBase-input').click();
cy.contains('Proceed').click();

cy.get('button[aria-label="Settings"]').click();

cy.get('#demo-simple-select').click();
cy.get(
`li[data-value="${networkPhrases.walletAppSelector}"]`,
).click();
cy.contains('button', 'Connect').click();
},
);

cy.acceptAccess();
}
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ export const phrasesList = {
minutes: 3,
token: 'ToyUSD',
network: 'emerynet',
walletAppSelector: 'testnet',
gov1Phrase: Cypress.env('GOV1_PHRASE'),
gov2Phrase: Cypress.env('GOV2_PHRASE'),
},
devnet: {
isLocal: false,
minutes: 3,
token: 'USDT_axl',
network: 'devnet',
walletAppSelector: 'devnet',
gov1Phrase: Cypress.env('GOV1_PHRASE'),
gov2Phrase: Cypress.env('GOV2_PHRASE'),
},
Expand Down
Loading