From 31ab41706201cadf09763273199af2aebd6dfcc2 Mon Sep 17 00:00:00 2001 From: Jeff See Date: Wed, 3 Jul 2024 12:08:22 -0700 Subject: [PATCH 1/2] chore(test): Remove windows-specific `prepare-install` (#432) There's a need to skip some integration tests for Windows, this PR moves the logic for skipping to the test setup itself rather than altering the tests and dependencies as we were doing in the `prepare-install` step. The pre-install logic was also deleting the `package-lock.json`, I'm not 100% clear on what the purpose was, but seems like it may have been done accidentally given the context of the [diff here](https://github.com/vercel/nft/pull/372#discussion_r1439789439). With the previous logic, CI started to fail on Windows because the `package-lock.json` was removed before install, causing us to install a later version of dependency. Instead of removing that line of code in the `prepare-install` file, just trying this approach which feels a little more straightforward. --------- Co-authored-by: Nathan Rajlich --- .github/workflows/ci.yml | 2 -- prepare-install.js | 22 ---------------------- test/integration.test.js | 21 ++++++++++++++++++++- 3 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 prepare-install.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c79cccce..f138d642 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,8 +38,6 @@ jobs: with: # we lock to 3.11 for a distutils requirement for node-gyp python-version: '3.11' - - name: Prepare Install (if applicable) - run: node prepare-install.js - name: Enable Corepack run: corepack enable npm - name: Install Dependencies diff --git a/prepare-install.js b/prepare-install.js deleted file mode 100644 index 70217f7a..00000000 --- a/prepare-install.js +++ /dev/null @@ -1,22 +0,0 @@ -const { unlinkSync, readFileSync, writeFileSync } = require('fs'); -const { join } = require('path'); - -const isWin = process.platform === 'win32'; - -if (isWin) { - const pkgJson = readFileSync(join(__dirname, 'package.json'), 'utf8'); - const pkg = JSON.parse(pkgJson); - - unlinkSync(join(__dirname, 'package-lock.json')); - // Delete the integration tests that will never work in Windows - unlinkSync(join(__dirname, 'test', 'integration', 'argon2.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'highlights.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'hot-shots.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'loopback.js')); - unlinkSync(join(__dirname, 'test', 'integration', 'playwright-core.js')); - delete pkg.devDependencies['argon2']; - delete pkg.devDependencies['highlights']; - delete pkg.devDependencies['hot-shots']; - - writeFileSync(join(__dirname, 'package.json'), JSON.stringify(pkg)); -} diff --git a/test/integration.test.js b/test/integration.test.js index 8a3ae867..7e497bdd 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -12,7 +12,26 @@ jest.setTimeout(200_000); const integrationDir = `${__dirname}${path.sep}integration`; -for (const integrationTest of readdirSync(integrationDir)) { +const integrationTests = readdirSync(integrationDir); +const filteredTestsToRun = integrationTests.filter((testName) => { + const isWin = process.platform === 'win32'; + // Filter the integration tests that will never work in Windows + if ( + isWin && + [ + 'argon2.js', + 'highlights.js', + 'hot-shots.js', + 'loopback.js', + 'playwright-core.js', + ].includes(testName) + ) { + return false; + } + return true; +}); + +for (const integrationTest of filteredTestsToRun) { let currentIntegrationDir = integrationDir; it(`should correctly trace and correctly execute ${integrationTest}`, async () => { From 2821dfa840410e8a3b904de7337516a73dfda632 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 3 Jul 2024 17:24:39 -0400 Subject: [PATCH 2/2] chore(ci): add cli team as codeowners (#433) Adding more codeowners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 15ab4fd6..9c434112 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # Documentation # https://help.github.com/en/articles/about-code-owners -* @ijjk @styfle +* @ijjk @styfle @vercel/vercel-cli-admins