From d18cce1a3ece419335a2222f962f741d5fa35fab Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Sat, 24 Aug 2024 13:29:58 +0500 Subject: [PATCH 1/2] test: update tests to include devnet --- tests/e2e/specs/proposal.spec.js | 30 ++++++++++++++++++------------ tests/e2e/utils.js | 10 ++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/tests/e2e/specs/proposal.spec.js b/tests/e2e/specs/proposal.spec.js index d0bc686..2d0ec97 100644 --- a/tests/e2e/specs/proposal.spec.js +++ b/tests/e2e/specs/proposal.spec.js @@ -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(); } diff --git a/tests/e2e/utils.js b/tests/e2e/utils.js index b08218d..12335dd 100644 --- a/tests/e2e/utils.js +++ b/tests/e2e/utils.js @@ -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'), }, From d0161ea4b8330a67d792c26dcc2b140af865b2d6 Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Sat, 24 Aug 2024 13:30:29 +0500 Subject: [PATCH 2/2] ci: update ci to include devnet --- .github/workflows/e2e_tests.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index e6194f6..0bb18f6 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -5,6 +5,9 @@ on: branches: [main] pull_request: branches: [main] + types: + - labeled + - synchronize schedule: - cron: '0 0 * * *' workflow_dispatch: @@ -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 || @@ -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' @@ -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 @@ -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 }} @@ -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: | @@ -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