Skip to content

Commit 9dc8653

Browse files
authored
Merge pull request #596 from AikidoSec/node-v24
Run tests & benchmarks on Node.js v24
2 parents 78c24e6 + df50ab7 commit 9dc8653

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

.github/workflows/benchmark.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
timeout-minutes: 10
2525
strategy:
2626
matrix:
27-
node-version: [18.x]
27+
node-version: [20.x, 24.x]
2828
steps:
2929
- uses: actions/checkout@v4
3030
- name: Use Node.js ${{ matrix.node-version }}
@@ -48,10 +48,15 @@ jobs:
4848
- name: Run shell injection Benchmark
4949
run: cd benchmarks/shell-injection && node benchmark.js
5050
- name: Run Hono with Postgres Benchmark
51+
# Skip on Node 24.x due to a bug: https://github.com/honojs/node-server/issues/240
52+
if: matrix.node-version != '24.x'
5153
run: cd benchmarks/hono-pg && node benchmark.js
5254
- name: Run API Discovery Benchmark
5355
run: cd benchmarks/api-discovery && node benchmark.js
5456
- name: Run Express Benchmark
57+
# Skip on Node 24.x because benchmark currently fails.
58+
# Big performance improve in comparison to older Node.js versions, but higher difference between usage with and without Zen
59+
if: matrix.node-version != '24.x'
5560
run: cd benchmarks/express && node benchmark.js
5661
- name: Check Rate Limiter memory usage
5762
run: cd benchmarks/rate-limiting && node --expose-gc memory.js

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
strategy:
6565
fail-fast: false
6666
matrix:
67-
node-version: [16.x, 18.x, 20.x, 22.x, 23.x]
67+
node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
6868
timeout-minutes: 10
6969
steps:
7070
- uses: actions/checkout@v4

end2end/server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22
1+
FROM node:22-slim
22

33
WORKDIR /app
44

library/agent/hooks/isBuiltinModule.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as t from "tap";
22
import { isBuiltinModule } from "./isBuiltinModule";
3+
import { getMajorNodeVersion } from "../../helpers/getNodeVersion";
34

45
t.test("it works", async (t) => {
56
t.equal(isBuiltinModule("fs"), true);
@@ -9,3 +10,16 @@ t.test("it works", async (t) => {
910
t.equal(isBuiltinModule("test"), false);
1011
t.equal(isBuiltinModule(""), false);
1112
});
13+
14+
t.test(
15+
"it works with node:sqlite",
16+
{
17+
skip:
18+
getMajorNodeVersion() < 24
19+
? "node:sqlite is not available in older Node.js versions"
20+
: undefined,
21+
},
22+
async (t) => {
23+
t.equal(isBuiltinModule("node:sqlite"), true);
24+
}
25+
);

library/package-lock.json

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

library/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"@types/xml2js": "^0.4.14",
7373
"aws-sdk": "^2.1595.0",
7474
"axios": "^1.8.4",
75-
"better-sqlite3": "^11.2.0",
75+
"better-sqlite3": "^11.9.1",
7676
"bson-objectid": "^2.0.4",
7777
"cookie-parser": "^1.4.6",
7878
"eslint": "^9.23.0",
@@ -89,9 +89,9 @@
8989
"globals": "^16.0.0",
9090
"graphql": "^16.8.2",
9191
"hono": "^4.4.2",
92+
"koa-router": "^12.0.1",
9293
"koa-v2": "npm:koa@^2.16.1",
9394
"koa-v3": "npm:koa@^3.0.0",
94-
"koa-router": "^12.0.1",
9595
"mariadb": "^3.3.2",
9696
"mongodb": "~6.9",
9797
"mongodb-v4": "npm:mongodb@^4.0.0",

scripts/run-tap.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@ if (process.env.CI) {
1515
args += " --coverage-report=lcov";
1616
}
1717

18-
// Enable the `--experimental-sqlite` flag for Node.js ^22.5.0
19-
if ((major === 22 && minor >= 5) || major === 23) {
20-
args += " --node-arg=--experimental-sqlite --node-arg=--no-warnings";
21-
}
22-
2318
execSync(`tap ${args}`, {
2419
stdio: "inherit",
2520
env: {
2621
...process.env,
2722
AIKIDO_CI: "true",
2823
// In v23 some sub-dependencies are calling require on a esm module triggering an experimental warning
29-
NODE_OPTIONS: major === 23 ? "--disable-warning=ExperimentalWarning" : "",
24+
NODE_OPTIONS: major === 24 ? "--disable-warning=ExperimentalWarning" : "",
3025
},
3126
});

0 commit comments

Comments
 (0)