Skip to content

Commit 81419e9

Browse files
fix: add _setupNodeVersion to CDK and E2E test setup functions (#3461)
## Problem Data Canary alarms are failling because the CDK canary test steps run on Node.js v18.15.0 instead of the configured v24.12.0. ### Root Cause `_setupCDKTestsLinux` and `_setupE2ETestsLinux` in `shared-scripts.sh` load the `.nvm` cache from S3 via `loadCacheFromBuildJob` but never call `_setupNodeVersion $AMPLIFY_NODE_VERSION` to activate NVM. This means the test phases fall back to the Docker image's system Node (v18.15.0). When `lru-cache` v11+ was published to npm. This version uses `diagnostics_channel.tracingChannel()`, which only exists in Node.js >= 20.5.0. Since the test phases were running Node 18, every canary test crashes with: ``` TypeError: (0 , R.tracingChannel) is not a function ``` Every other function in `shared-scripts.sh` correctly calls `_setupNodeVersion`: Only `_setupCDKTestsLinux` and `_setupE2ETestsLinux` were missing it. ### Testing The `build_linux` phase already uses `_setupNodeVersion` successfully with Node 24.12.0 — this change makes the test phases consistent with it.
2 parents e7af293 + ded4cd6 commit 81419e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

shared-scripts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,7 @@ function _setupE2ETestsLinux {
334334
echo "Setup E2E Tests Linux"
335335
loadCacheFromBuildJob
336336
loadCache verdaccio-cache $CODEBUILD_SRC_DIR/../verdaccio-cache
337-
# Ignore engines while we're still on Node 18.x
338-
yarn config set ignore-engines true
337+
_setupNodeVersion $AMPLIFY_NODE_VERSION
339338
_installCLIFromLocalRegistry
340339
_loadTestAccountCredentials
341340
_setShell
@@ -345,6 +344,7 @@ function _setupCDKTestsLinux {
345344
echo "Setup E2E Tests Linux"
346345
loadCacheFromBuildJob
347346
loadCache verdaccio-cache $CODEBUILD_SRC_DIR/../verdaccio-cache
347+
_setupNodeVersion $AMPLIFY_NODE_VERSION
348348
_installCLIFromLocalRegistry
349349
yarn package
350350
_loadTestAccountCredentials

0 commit comments

Comments
 (0)