Skip to content

Commit f54aa81

Browse files
Add Node 24 to CI test matrix (#1762)
Co-authored-by: Chris Olszewski <chris.olszewski@temporal.io>
1 parent d91ca1e commit f54aa81

16 files changed

+105
-39
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
strategy:
114114
fail-fast: false
115115
matrix:
116-
node: [18, 22] # Min and max supported Node versions
116+
node: [18, 22, 24] # Min and max officially supported Node versions + next max
117117
platform: [linux-x64, linux-arm, macos-x64, macos-arm, windows-x64]
118118
include:
119119
- platform: linux-x64

.github/workflows/conventions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Node
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20
22+
node-version: 22
2323

2424
- name: Get NPM cache directory
2525
id: npm-cache-dir

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Install Node
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: 20
41+
node-version: 22
4242

4343
- name: Get NPM cache directory
4444
id: npm-cache-dir

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
- name: Install Node
169169
uses: actions/setup-node@v4
170170
with:
171-
node-version: 20
171+
node-version: 22
172172

173173
- name: Get NPM cache directory
174174
id: npm-cache-dir
@@ -213,7 +213,7 @@ jobs:
213213
strategy:
214214
fail-fast: false
215215
matrix:
216-
node: [18, 22] # Min and max supported Node versions
216+
node: [18, 22, 24] # Min and max officially supported Node versions + next max
217217
platform: [linux-x64, linux-arm, macos-x64, macos-arm, windows-x64]
218218
sample: [hello-world, fetch-esm, hello-world-mtls]
219219
server: [cli, cloud]

.github/workflows/stress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Install Node
6363
uses: actions/setup-node@v4
6464
with:
65-
node-version: 20
65+
node-version: 22
6666

6767
- name: Get NPM cache directory
6868
id: npm-cache-dir

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ packages/*/package-lock.json
1616
# One test creates persisted SQLite DBs; they should normally be deleted automatically,
1717
# but may be left behind in some error scenarios.
1818
packages/test/temporal-db-*.sqlite
19+
.DS_Store

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ See [sdk-structure.md](./docs/sdk-structure.md)
5050

5151
### Environment setup
5252

53-
The TS SDK can be executed on 18, 20 or 22. However, we recommend using Node 22 for SDK development.
53+
TS SDK is officially supported on Node 18, 20, 22, or 24. However, we recommend using the
54+
[Active LTS](https://nodejs.org/en/about/previous-releases#nodejs-releases) for SDK development.
5455
For easier testing during development you may want to use a version manager, such as
5556
[fnm](https://github.com/Schniz/fnm) or [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md).
5657

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/test/src/helpers.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as net from 'net';
33
import path from 'path';
44
import * as grpc from '@grpc/grpc-js';
55
import asyncRetry from 'async-retry';
6-
import ava, { TestFn } from 'ava';
6+
import ava, { TestFn, ExecutionContext } from 'ava';
77
import StackUtils from 'stack-utils';
88
import { v4 as uuid4 } from 'uuid';
99
import { Client, Connection } from '@temporalio/client';
@@ -98,6 +98,21 @@ export function cleanStackTrace(ostack: string): string {
9898
return normalizedStack ? `${firstLine}\n${normalizedStack}` : firstLine;
9999
}
100100

101+
/**
102+
* Compare stack traces using $CLASS keyword to match any inconsistent identifiers
103+
*
104+
* As of Node 24.6.0 type names are now present on source mapped stack traces which leads
105+
* to different stack traces depending on Node version.
106+
* See [f33e0fcc83954f728fcfd2ef6ae59435bc4af059](https://github.com/nodejs/node/commit/f33e0fcc83954f728fcfd2ef6ae59435bc4af059)
107+
*/
108+
export function compareStackTrace(t: ExecutionContext, actual: string, expected: string): void {
109+
const escapedTrace = expected
110+
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
111+
.replace(/-/g, '\\x2d')
112+
.replaceAll('\\$CLASS', '(?:[A-Za-z]+)');
113+
t.regex(actual, RegExp(`^${escapedTrace}$`));
114+
}
115+
101116
function noopTest(): void {
102117
// eslint: this function body is empty and it's okay.
103118
}

packages/test/src/test-integration-split-one.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
} from '@temporalio/workflow';
3737
import { configurableHelpers, createTestWorkflowBundle } from './helpers-integration';
3838
import * as activities from './activities';
39-
import { cleanOptionalStackTrace, u8, Worker } from './helpers';
39+
import { cleanOptionalStackTrace, compareStackTrace, u8, Worker } from './helpers';
4040
import { configMacro, makeTestFn } from './helpers-integration-multi-codec';
4141
import * as workflows from './workflows';
4242

@@ -204,11 +204,12 @@ test.serial('activity-failure with ApplicationFailure', configMacro, async (t, c
204204
t.is(err.cause.cause.message, 'Fail me');
205205
t.is(err.cause.cause.type, 'Error');
206206
t.deepEqual(err.cause.cause.details, ['details', 123, false]);
207-
t.is(
208-
cleanOptionalStackTrace(err.cause.cause.stack),
207+
compareStackTrace(
208+
t,
209+
cleanOptionalStackTrace(err.cause.cause.stack)!,
209210
dedent`
210211
ApplicationFailure: Fail me
211-
at Function.nonRetryable (common/src/failure.ts)
212+
at $CLASS.nonRetryable (common/src/failure.ts)
212213
at throwAnError (test/src/activities/index.ts)
213214
`
214215
);
@@ -258,11 +259,12 @@ test.serial('child-workflow-failure', configMacro, async (t, config) => {
258259
return t.fail('Expected err.cause.cause to be an instance of ApplicationFailure');
259260
}
260261
t.is(err.cause.cause.message, 'failure');
261-
t.is(
262-
cleanOptionalStackTrace(err.cause.cause.stack),
262+
compareStackTrace(
263+
t,
264+
cleanOptionalStackTrace(err.cause.cause.stack)!,
263265
dedent`
264266
ApplicationFailure: failure
265-
at Function.nonRetryable (common/src/failure.ts)
267+
at $CLASS.nonRetryable (common/src/failure.ts)
266268
at throwAsync (test/src/workflows/throw-async.ts)
267269
`
268270
);

0 commit comments

Comments
 (0)