Skip to content

Commit b12c1b0

Browse files
authored
test: run functions-discover test on Node 24 (#10474)
* test: run functions-discover test on Node 24 ### Description The test:functions-discover test was failing on Node 20 because the latest pnpm requires Node 22+ (due to node:sqlite). This PR updates the CI workflow to run this specific test on Node 24 instead. ### Scenarios Tested - Verified that the workflow file syntax is correct. - Verified that run.sh is restored to use the latest pnpm. ### Sample Commands npm run test:functions-discover * test: allow built dependencies in pnpm fixture ### Description Newer versions of pnpm require explicit approval for build scripts. This PR adds onlyBuiltDependencies to the pnpm fixture's package.json to allow @firebase/util and protobufjs to run their build scripts. ### Scenarios Tested - Verified that the fixture package.json was updated. * test: ignore scripts in pnpm fixture install ### Description Adding onlyBuiltDependencies to package.json didn't resolve the ERR_PNPM_IGNORED_BUILDS error in CI. This PR switches to using pnpm install --ignore-scripts in the fixture's install script to bypass the issue entirely, as the test likely does not need the build scripts to run. ### Scenarios Tested - Verified that the fixture install.sh was updated.
1 parent dd02603 commit b12c1b0

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/node-test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ jobs:
207207
- npm run test:emulator
208208
- npm run test:extensions-emulator
209209
- npm run test:frameworks
210-
- npm run test:functions-discover
211210
- npm run test:hosting
212211
# - npm run test:hosting-rewrites # Long-running test that might conflict across test runs. Run this manually.
213212
- npm run test:import-export
@@ -217,6 +216,9 @@ jobs:
217216
- npm run test:triggers-end-to-end:inspect
218217
# - npm run test:dataconnect-deploy
219218
- npm run test:dataconnect-emulator
219+
include:
220+
- node-version: "24"
221+
script: "npm run test:functions-discover"
220222
steps:
221223
- uses: actions/checkout@v4
222224
- uses: actions/setup-node@v3
@@ -276,14 +278,16 @@ jobs:
276278
- npm run test:emulator
277279
# - npm run test:import-export # Fails becuase port 4000 is taken after first run - hub not shutting down?
278280
# - npm run test:extensions-emulator # Fails due to cannot find module sharp (not waiting for npm install?)
279-
- npm run test:functions-discover
280281
# - npm run test:triggers-end-to-end
281282
- npm run test:triggers-end-to-end:inspect
282283
- npm run test:storage-deploy
283284
# - npm run test:storage-emulator-integration
284285
# - npm run test:dataconnect-deploy # TODO (joehanley): Reenable this - it should be safe to run in parallel
285286
# - npm run test:dataconnect-emulator # TODO (joehanley): Figure out why this is failing
286287
# - npm run test:frameworks
288+
include:
289+
- node-version: "24"
290+
script: "npm run test:functions-discover"
287291
steps:
288292
- name: Setup Java JDK
289293
uses: actions/setup-java@v3.3.0

scripts/functions-discover-tests/fixtures/pnpm/functions/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
"name": "pnpm",
33
"dependencies": {
44
"firebase-functions": "^6.4.0"
5+
},
6+
"pnpm": {
7+
"onlyBuiltDependencies": [
8+
"@firebase/util",
9+
"protobufjs"
10+
]
511
}
612
}

scripts/functions-discover-tests/fixtures/pnpm/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
set -euxo pipefail # bash strict mode
33
IFS=$'\n\t'
44

5-
cd functions && pnpm install
5+
cd functions && pnpm install --ignore-scripts

0 commit comments

Comments
 (0)