From 7ee14c93414ccb1f295c31c7483e8b29bd2e736e Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Thu, 20 Jun 2024 16:49:30 -0700 Subject: [PATCH 1/9] npm cache and cypress action --- .github/workflows/e2e-tests.yml | 46 ++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index fbd73a4d..b65dd56f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -28,9 +28,23 @@ jobs: with: node-version: ${{ matrix.node }} - - run: npm install -g npm - - - run: npm install + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list # build monorepo incl. each subpackage - run: npm run build --workspaces --if-present @@ -42,14 +56,26 @@ jobs: run: | dfx start --background - - name: setup - id: setup - run: npm run setup --workspaces --if-present + # - name: setup + # id: setup + # run: npm run setup --workspaces --if-present - - run: npm run e2e --workspaces --if-present - env: - CI: true - REPLICA_PORT: 4943 + # - run: npm run e2e --workspace e2e/node + # env: + # CI: true + # REPLICA_PORT: 4943 + + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + install: false + project: ./e2e/browser + working-directory: e2e/browser + start: | + npm run setup + npm run e2e + wait-on: 'http://localhost:1234' + wait-on-timeout: 120 aggregate: name: e2e:required From 8bba9b93e528834b753c2f48de85a314aa25be73 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Thu, 20 Jun 2024 16:52:23 -0700 Subject: [PATCH 2/9] build command --- .github/workflows/e2e-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index b65dd56f..f666ccef 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -45,6 +45,8 @@ jobs: name: List the state of node modules continue-on-error: true run: npm list + - run: npm ci + - run: npm run build -ws # build monorepo incl. each subpackage - run: npm run build --workspaces --if-present From 18267053fded627212e7342c6b138483121a1e75 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 13:48:11 -0700 Subject: [PATCH 3/9] setup separate step --- .github/workflows/e2e-tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f666ccef..123df961 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -58,9 +58,9 @@ jobs: run: | dfx start --background - # - name: setup - # id: setup - # run: npm run setup --workspaces --if-present + - name: setup + id: setup + run: npm run setup --workspaces --if-present # - run: npm run e2e --workspace e2e/node # env: @@ -74,7 +74,6 @@ jobs: project: ./e2e/browser working-directory: e2e/browser start: | - npm run setup npm run e2e wait-on: 'http://localhost:1234' wait-on-timeout: 120 From c149105a06fbca00d97822e8aad3fb25e4b46232 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 13:58:57 -0700 Subject: [PATCH 4/9] no working directory --- .github/workflows/e2e-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 123df961..1387c45f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -72,7 +72,6 @@ jobs: with: install: false project: ./e2e/browser - working-directory: e2e/browser start: | npm run e2e wait-on: 'http://localhost:1234' From c39caa4155b2b7bfa25c5ae8d359358432be3598 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 14:12:39 -0700 Subject: [PATCH 5/9] workspace command --- .github/workflows/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 1387c45f..e857302f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -73,7 +73,7 @@ jobs: install: false project: ./e2e/browser start: | - npm run e2e + npm run e2e --workspace e2e/node wait-on: 'http://localhost:1234' wait-on-timeout: 120 From 143754c5b0604aa5e73bbb7430600ca1df8302e9 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 14:18:25 -0700 Subject: [PATCH 6/9] restoring node tests --- .github/workflows/e2e-tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index e857302f..0068c994 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -62,12 +62,13 @@ jobs: id: setup run: npm run setup --workspaces --if-present - # - run: npm run e2e --workspace e2e/node - # env: - # CI: true - # REPLICA_PORT: 4943 + - name: Node.js e2e tests + run: npm run e2e --workspace e2e/node + env: + CI: true + REPLICA_PORT: 4943 - - name: Cypress run + - name: Cypress e2e tests uses: cypress-io/github-action@v6 with: install: false From fa41d063e912ef54208ef1331d3ccce867f9bbf9 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 14:31:13 -0700 Subject: [PATCH 7/9] increasing test timeout --- e2e/node/basic/mainnet.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/node/basic/mainnet.test.ts b/e2e/node/basic/mainnet.test.ts index 3fea750e..a6a5ac59 100644 --- a/e2e/node/basic/mainnet.test.ts +++ b/e2e/node/basic/mainnet.test.ts @@ -110,7 +110,7 @@ describe('certified query', () => { }, ] `); - }); + }, 20_000); }); describe('controllers', () => { From c188d6ff92022caffa7ef6c5bc919dc96e6274c1 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 14:43:35 -0700 Subject: [PATCH 8/9] even longer --- e2e/node/basic/mainnet.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/node/basic/mainnet.test.ts b/e2e/node/basic/mainnet.test.ts index a6a5ac59..05e8ccd4 100644 --- a/e2e/node/basic/mainnet.test.ts +++ b/e2e/node/basic/mainnet.test.ts @@ -110,7 +110,7 @@ describe('certified query', () => { }, ] `); - }, 20_000); + }, 30_000); }); describe('controllers', () => { From c3b81d92ace723d9aa92dd6b186cc3d38c46ad5d Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Fri, 21 Jun 2024 14:59:59 -0700 Subject: [PATCH 9/9] chore: changelog --- docs/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e7b3ada9..1a95dc57 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- ci: using cypress github action for e2e tests + ## [1.4.0] - 2024-06-17 ### Added