From 41619c5d76d4c422b7b7ced79b1088d3d2c718ed Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Wed, 6 Mar 2024 15:46:59 -0500 Subject: [PATCH 1/8] bump actions to node v20 --- .github/workflows/docs-publish.yml | 10 ++++----- .github/workflows/release-notify.yml | 2 +- .github/workflows/scorecard.yml | 2 +- .github/workflows/tests-ci.yml | 31 ++++++++++------------------ 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 2fefdb47e..ce64280de 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -70,7 +70,7 @@ jobs: readmeFile: packages/credentials/README.md - name: Upload documentation artifacts - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1 with: name: tbdocs-output path: ./.tbdocs @@ -97,19 +97,19 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Setup Pages - uses: actions/configure-pages@b8130d9ab958b325bbde9786d62f2c97a9885a0e #v3.0.7 + uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d #v4.0.0 - name: Download TBDocs Artifacts - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 #v4.1.4 with: name: tbdocs-output path: ./tbdocs - name: Upload artifact - uses: actions/upload-pages-artifact@84bb4cd4b733d5c320c9c9cfbc354937524f4d64 #v1.0.10 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1 with: path: "./tbdocs/docs" - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@de14547edc9944350dc0481aa5b7afb08e75f254 #v2.0.5 + uses: actions/deploy-pages@decdde0ac072f6dcbe43649d82d9c635fff5b4e4 #v4.0.4 diff --git a/.github/workflows/release-notify.yml b/.github/workflows/release-notify.yml index dffbc8632..a7ebeea5b 100644 --- a/.github/workflows/release-notify.yml +++ b/.github/workflows/release-notify.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Create Issue - uses: actions/github-script@v6 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 with: github-token: ${{ secrets.DOCS_PAT }} # Assuming 'PAT' is your Personal Access Token stored as a secret script: | diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 55b75686f..e3fbdf002 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1 with: name: SARIF file path: results.sarif diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index 640aa8bc6..9042d57fb 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -18,15 +18,11 @@ jobs: - name: Checkout source uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3.0.0 - with: - version: 8 - - - name: Set up Node.js - uses: actions/setup-node@5ef044f9d09786428e6e895be6be17937becee3a #v4.0.0 + # https://cashapp.github.io/hermit/usage/ci/ + - name: Init Hermit + uses: cashapp/activate-hermit@v1 with: - node-version: 18 - cache: 'pnpm' + cache: "true" - name: Report known vulnerabilities run: pnpm audit @@ -39,16 +35,11 @@ jobs: with: submodules: true - - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3.0.0 - with: - version: 8 - - - name: Set up Node.js - uses: actions/setup-node@5ef044f9d09786428e6e895be6be17937becee3a #v4.0.0 + # https://cashapp.github.io/hermit/usage/ci/ + - name: Init Hermit + uses: cashapp/activate-hermit@v1 with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' + cache: "true" - name: Install dependencies run: pnpm install --frozen-lockfile @@ -78,13 +69,13 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results to update SDK reports - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: junit-results path: packages/*/results.xml - name: Generate an access token to trigger downstream repo - uses: actions/create-github-app-token@2986852ad836768dfea7781f31828eb3e17990fa # v1.6.2 + uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1.9.0 id: generate_token if: github.ref == 'refs/heads/main' with: @@ -144,7 +135,7 @@ jobs: - name: Restore Cached Playwright Browsers id: cache-playwright-restore - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2 + uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1 with: path: ~/Library/Caches/ms-playwright key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} From 2a49e3eeebae62406efa1b0c9db517662f82e6fc Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Wed, 6 Mar 2024 16:51:16 -0500 Subject: [PATCH 2/8] debug what node is doing --- .github/workflows/tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index 9042d57fb..35c9cf9a9 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -56,7 +56,7 @@ jobs: echo "DWN_SERVER_BACKGROUND_PROCESS=$!" >> $GITHUB_ENV - name: Run tests for all packages - run: pnpm --recursive --no-stream --sequential test:node -- --color --reporter mocha-junit-reporter --reporter-options mochaFile=./results.xml + run: npm run test:node --ws -- --color env: TEST_DWN_URL: http://localhost:3000 From c5e3183dc01d69399e14d16508cdf727fea91b1a Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Wed, 6 Mar 2024 17:16:42 -0500 Subject: [PATCH 3/8] try timeout --- packages/agent/.mocharc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/agent/.mocharc.json b/packages/agent/.mocharc.json index 5aa8c5bfe..8303e434d 100644 --- a/packages/agent/.mocharc.json +++ b/packages/agent/.mocharc.json @@ -1,5 +1,6 @@ { "enable-source-maps": true, "exit": true, - "spec": ["tests/compiled/**/*.spec.js"] + "spec": ["tests/compiled/**/*.spec.js"], + "timeout": 5000 } \ No newline at end of file From 0782a509c273b3e05085e34dc20bebb010f258b1 Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Wed, 6 Mar 2024 17:31:12 -0500 Subject: [PATCH 4/8] add back correct test script and parallelize mocha --- .github/workflows/tests-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index 35c9cf9a9..820fc0b89 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -55,8 +55,11 @@ jobs: node node_modules/@web5/dwn-server/dist/esm/src/main.js & echo "DWN_SERVER_BACKGROUND_PROCESS=$!" >> $GITHUB_ENV + - name: Build tests for all packages + run: pnpm --recursive --stream --sequential build:tests:node + - name: Run tests for all packages - run: npm run test:node --ws -- --color + run: pnpm --recursive --stream exec c8 mocha -- --color --reporter mocha-junit-reporter --reporter-options mochaFile=./results.xml env: TEST_DWN_URL: http://localhost:3000 From 05f19b2bdab7af12a83c095ae116f0a1e4783a6f Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Mon, 11 Mar 2024 13:12:14 -0400 Subject: [PATCH 5/8] Remove global timeout for agent package --- packages/agent/.mocharc.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/agent/.mocharc.json b/packages/agent/.mocharc.json index 8303e434d..5aa8c5bfe 100644 --- a/packages/agent/.mocharc.json +++ b/packages/agent/.mocharc.json @@ -1,6 +1,5 @@ { "enable-source-maps": true, "exit": true, - "spec": ["tests/compiled/**/*.spec.js"], - "timeout": 5000 + "spec": ["tests/compiled/**/*.spec.js"] } \ No newline at end of file From 9a002e60691f5a6de0ede00339ffc98b81e4102a Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Mon, 11 Mar 2024 13:19:47 -0400 Subject: [PATCH 6/8] troubleshoot timeout --- .github/workflows/tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index 820fc0b89..b156e1a00 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -59,7 +59,7 @@ jobs: run: pnpm --recursive --stream --sequential build:tests:node - name: Run tests for all packages - run: pnpm --recursive --stream exec c8 mocha -- --color --reporter mocha-junit-reporter --reporter-options mochaFile=./results.xml + run: npm run test:node --ws -- --color env: TEST_DWN_URL: http://localhost:3000 From e7c4539f5296cd6361a3c21bf0d60a219b87e2b6 Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Mon, 11 Mar 2024 13:28:15 -0400 Subject: [PATCH 7/8] Bump timeouts for sync tests Signed-off-by: Frank Hinek --- packages/agent/tests/sync-manager.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/agent/tests/sync-manager.spec.ts b/packages/agent/tests/sync-manager.spec.ts index 70a205267..fbe04a33b 100644 --- a/packages/agent/tests/sync-manager.spec.ts +++ b/packages/agent/tests/sync-manager.spec.ts @@ -292,7 +292,7 @@ describe('SyncManagerLevel', () => { expect(reply.status.code).to.equal(200); expect(reply.record).to.not.be.undefined; expect(reply.record!.data).to.not.be.undefined; // record data exists - }); + }).timeout(5000); it('synchronizes records for multiple identities from remote DWN to local DWN', async () => { // Create a second Identity to author the DWN messages. @@ -488,7 +488,7 @@ describe('SyncManagerLevel', () => { expect(reply.status.code).to.equal(200); expect(reply.record).to.not.be.undefined; expect(reply.record!.data).to.not.be.undefined; - }); + }).timeout(5000); it('synchronizes records for multiple identities from local DWN to remote DWN', async () => { // Create a second Identity to author the DWN messages. From 508503683d39221781a00fce598024ac33fe260d Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Mon, 11 Mar 2024 13:37:43 -0400 Subject: [PATCH 8/8] Revert to Tim's changes after resolving timeouts --- .github/workflows/tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index b156e1a00..820fc0b89 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -59,7 +59,7 @@ jobs: run: pnpm --recursive --stream --sequential build:tests:node - name: Run tests for all packages - run: npm run test:node --ws -- --color + run: pnpm --recursive --stream exec c8 mocha -- --color --reporter mocha-junit-reporter --reporter-options mochaFile=./results.xml env: TEST_DWN_URL: http://localhost:3000