From 2d195f84d1cf20a80b6d7264090665ad8d33f86b Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Thu, 26 Oct 2023 11:47:17 -0700 Subject: [PATCH 1/5] chore: replaces use of localhost with 127.0.0.1 for better node 18 support (#787) * chore: replaces use of localhost with 127.0.0.1 for better node 18 support * replaces jest with vitest for e2e * runs mitm tests against mainnet --- .github/workflows/e2e-tests.yml | 4 + .github/workflows/mitm.yml | 11 +- demos/sample-javascript/README.md | 2 +- docs/generated/changelog.html | 4 + e2e/browser/.proxyrc | 2 +- e2e/browser/cypress/e2e/ecdsa.cy.js | 19 +- e2e/browser/package.json | 10 +- e2e/node/basic/assets.test.ts | 17 +- e2e/node/basic/basic.test.ts | 1 + e2e/node/basic/canisterStatus.test.ts | 10 +- e2e/node/basic/counter.test.ts | 18 +- e2e/node/basic/identity.test.ts | 95 +- e2e/node/basic/mainnet.test.ts | 115 ++ e2e/node/basic/mitm.test.ts | 29 +- e2e/node/canisters/counter.ts | 32 +- .../declarations/counter/counter.did | 8 + .../declarations/counter/counter.did.d.ts | 11 + .../declarations/counter/counter.did.js | 13 + .../canisters/declarations/counter/index.d.ts | 45 + .../canisters/declarations/counter/index.ts | 37 + e2e/node/jest.config.ts | 20 - e2e/node/package.json | 11 +- e2e/node/tsconfig.json | 14 +- e2e/node/utils/agent.ts | 25 +- e2e/node/vitest.config.ts | 8 + package-lock.json | 1215 +++++++++++++++-- packages/agent/README.md | 4 +- packages/agent/src/actor.test.ts | 18 +- packages/agent/src/agent/http/http.test.ts | 32 +- packages/agent/src/agent/http/index.ts | 4 +- packages/agent/src/fetch_candid.test.ts | 2 +- packages/auth-client/src/index.test.ts | 20 +- packages/auth-client/src/index.ts | 2 +- 33 files changed, 1532 insertions(+), 326 deletions(-) create mode 100644 e2e/node/basic/mainnet.test.ts create mode 100644 e2e/node/canisters/declarations/counter/counter.did create mode 100644 e2e/node/canisters/declarations/counter/counter.did.d.ts create mode 100644 e2e/node/canisters/declarations/counter/counter.did.js create mode 100644 e2e/node/canisters/declarations/counter/index.d.ts create mode 100644 e2e/node/canisters/declarations/counter/index.ts delete mode 100644 e2e/node/jest.config.ts create mode 100644 e2e/node/vitest.config.ts diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 21338101f..deebec5f9 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -42,6 +42,10 @@ jobs: run: | dfx start --background + - name: setup + id: setup + run: npm run setup --workspaces --if-present + - run: npm run e2e --workspaces --if-present env: CI: true diff --git a/.github/workflows/mitm.yml b/.github/workflows/mitm.yml index d2fa2d52b..1890237fd 100644 --- a/.github/workflows/mitm.yml +++ b/.github/workflows/mitm.yml @@ -7,6 +7,7 @@ on: - reopened - edited - synchronize + workflow_dispatch: jobs: test: @@ -37,8 +38,8 @@ jobs: - uses: actions/setup-python@v2 with: - python-version: '3.8' - - run: pip3 install mitmproxy~=8.0.0 + python-version: '3.11' + - run: pip3 install mitmproxy~=10.0.0 - run: echo y | sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)" @@ -51,17 +52,15 @@ jobs: id: mitmdump run: | set -ex - mitmdump -p 8888 --mode reverse:http://127.0.0.1:4943 \ + mitmdump -p 8888 --mode reverse:https://icp-api.io \ --modify-headers '/~s/Transfer-Encoding/' \ --modify-body '/~s/Hello/Hullo' \ & - sleep 5 + sleep 20 - name: mitm e2e env: CI: true - REPLICA_PORT: 8888 - MITM: true run: npm run mitm --workspaces --if-present aggregate: diff --git a/demos/sample-javascript/README.md b/demos/sample-javascript/README.md index 5b3647013..59a063859 100644 --- a/demos/sample-javascript/README.md +++ b/demos/sample-javascript/README.md @@ -6,4 +6,4 @@ 1. Ensure all dependencies are installed: `npm install` 2. Run the development server `npm run develop` -3. Visit the running site at http://localhost:8080 +3. Visit the running site at http://127.0.0.1:8080 diff --git a/docs/generated/changelog.html b/docs/generated/changelog.html index 0581bc387..491c78ecd 100644 --- a/docs/generated/changelog.html +++ b/docs/generated/changelog.html @@ -12,6 +12,10 @@

Agent-JS Changelog

Version x.x.x