Commit 81419e9
authored
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.1 file changed
Lines changed: 2 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
| 337 | + | |
339 | 338 | | |
340 | 339 | | |
341 | 340 | | |
| |||
345 | 344 | | |
346 | 345 | | |
347 | 346 | | |
| 347 | + | |
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| |||
0 commit comments