From 55bdf51604702f167fad7ebb0fe81dd9a775b44d Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Tue, 11 Jun 2024 17:19:49 +0500 Subject: [PATCH 1/2] chore: formatter run on file --- .github/workflows/e2e_tests.yml | 6 +++--- package.json | 2 +- tests/e2e/docker-compose.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index dcf2cda..7d4b25f 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -20,7 +20,7 @@ on: phrase: description: 'The mnemonic phrase for the account to use in testing' required: false - type: text + type: string concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || @@ -57,8 +57,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: ${{ 'true' == 'true' && 'daily-tests' || 'synpress' }} + CYPRESS_AGORIC_NET: ${{ 'true' == 'true' && 'emerynet' || 'local' }} # for docker-compose.yml COMPOSE_DOCKER_CLI_BUILD: 1 DOCKER_BUILDKIT: 1 diff --git a/package.json b/package.json index f9d88aa..aeac17a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "vitest", "coverage": "vitest run --coverage", "test:e2e": "EXTENSION=keplr SKIP_EXTENSION_SETUP=true synpress run --configFile=tests/e2e/synpress.config.cjs", - "test:e2e:ci": "start-server-and-test 'yarn dev' http-get://localhost:5173 'yarn test:e2e'" + "test:e2e:ci": "yarn dev & sleep 10 && yarn test:e2e" }, "dependencies": { "react": "^18.2.0", diff --git a/tests/e2e/docker-compose.yml b/tests/e2e/docker-compose.yml index cd7de6b..f08cd7d 100644 --- a/tests/e2e/docker-compose.yml +++ b/tests/e2e/docker-compose.yml @@ -48,7 +48,7 @@ services: - ./docker/videos:/app/tests/e2e/videos - ./docker/screenshots:/app/tests/e2e/screenshots command: > - bash -c 'echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && if [ "$CYPRESS_AGORIC_NET" == "local" ]; then nginx; fi && yarn test:e2e:ci' + bash -c 'pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && if [ "$CYPRESS_AGORIC_NET" == "local" ]; then nginx; fi && yarn test:e2e:ci' networks: - x11 @@ -104,7 +104,7 @@ services: profiles: - synpress container_name: agoric_chain - image: ghcr.io/agoric/agoric-3-proposals:main + image: ghcr.io/agoric/agoric-3-proposals:latest logging: driver: none platform: linux/amd64 From bde01c836763f0a2082987e360d9504d3fe50e68 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Thu, 13 Jun 2024 20:58:13 +0500 Subject: [PATCH 2/2] ci: prefer ipv4 resolution for e2e tests --- .github/workflows/e2e_tests.yml | 4 ++-- Dockerfile | 6 ++++++ package.json | 2 +- tests/e2e/docker-compose.yml | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 7d4b25f..827672b 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -57,8 +57,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: ${{ 'true' == 'true' && 'daily-tests' || 'synpress' }} - CYPRESS_AGORIC_NET: ${{ 'true' == 'true' && 'emerynet' || 'local' }} + SYNPRESS_PROFILE: ${{ env.IS_EMERYNET_TEST == 'true' && 'daily-tests' || 'synpress' }} + CYPRESS_AGORIC_NET: ${{ env.IS_EMERYNET_TEST == 'true' && 'emerynet' || 'local' }} # for docker-compose.yml COMPOSE_DOCKER_CLI_BUILD: 1 DOCKER_BUILDKIT: 1 diff --git a/Dockerfile b/Dockerfile index 55c1d76..f7d47ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,12 @@ # syntax=docker/dockerfile:1 FROM --platform=linux/amd64 synthetixio/docker-e2e:18.16-ubuntu as base +# Recent e2e test failures for all dApps were due to inconsistent network configurations in the CI setup. +# GitHub Actions infrastructure can resolve localhost inconsistently (IPv4 or IPv6). +# To address this, we set NODE_OPTIONS=--dns-result-order=ipv4first to prioritize IPv4 DNS resolution. +# For more details, see: https://github.com/cypress-io/cypress/issues/27962 +ENV NODE_OPTIONS=--dns-result-order=ipv4first + RUN mkdir /app WORKDIR /app diff --git a/package.json b/package.json index aeac17a..f9d88aa 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "vitest", "coverage": "vitest run --coverage", "test:e2e": "EXTENSION=keplr SKIP_EXTENSION_SETUP=true synpress run --configFile=tests/e2e/synpress.config.cjs", - "test:e2e:ci": "yarn dev & sleep 10 && yarn test:e2e" + "test:e2e:ci": "start-server-and-test 'yarn dev' http-get://localhost:5173 'yarn test:e2e'" }, "dependencies": { "react": "^18.2.0", diff --git a/tests/e2e/docker-compose.yml b/tests/e2e/docker-compose.yml index f08cd7d..cd7de6b 100644 --- a/tests/e2e/docker-compose.yml +++ b/tests/e2e/docker-compose.yml @@ -48,7 +48,7 @@ services: - ./docker/videos:/app/tests/e2e/videos - ./docker/screenshots:/app/tests/e2e/screenshots command: > - bash -c 'pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && if [ "$CYPRESS_AGORIC_NET" == "local" ]; then nginx; fi && yarn test:e2e:ci' + bash -c 'echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && if [ "$CYPRESS_AGORIC_NET" == "local" ]; then nginx; fi && yarn test:e2e:ci' networks: - x11 @@ -104,7 +104,7 @@ services: profiles: - synpress container_name: agoric_chain - image: ghcr.io/agoric/agoric-3-proposals:latest + image: ghcr.io/agoric/agoric-3-proposals:main logging: driver: none platform: linux/amd64