Skip to content

Commit ff804be

Browse files
tlhunterrochdev
authored andcommitted
ci: fix express node v24 test (#6283)
1 parent 0312ab8 commit ff804be

File tree

7 files changed

+41
-2
lines changed

7 files changed

+41
-2
lines changed

.github/workflows/apm-integrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ jobs:
307307
steps:
308308
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
309309
- uses: ./.github/actions/testagent/start
310-
- uses: ./.github/actions/node/active-lts # TODO: change this to latest once we figure out the `fresh` bug
310+
- uses: ./.github/actions/node/latest
311311
- uses: ./.github/actions/install
312312
- run: yarn test:plugins:ci
313313

.github/workflows/appsec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
- uses: ./.github/actions/node/oldest-maintenance-lts
128128
- uses: ./.github/actions/install
129129
- run: yarn test:appsec:plugins:ci
130-
- uses: ./.github/actions/node/active-lts # TODO: change this to latest once we figure out the `fresh` bug
130+
- uses: ./.github/actions/node/latest
131131
- run: yarn test:appsec:plugins:ci
132132
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
133133

packages/datadog-plugin-express/test/index.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
const { NODE_MAJOR } = require('../../../version')
34
const { AsyncLocalStorage } = require('async_hooks')
45
const axios = require('axios')
56
const semver = require('semver')
@@ -17,6 +18,12 @@ describe('Plugin', () => {
1718

1819
describe('express', () => {
1920
withVersions('express', 'express', version => {
21+
// Express.js 4.10.5 and below have a Node.js incompatibility in the `fresh` package RE res._headers missing
22+
if (semver.intersects(version, '<=4.10.5') && NODE_MAJOR >= 24) {
23+
describe.skip(`refusing to run tests as express@${version} is incompatible with Node.js ${NODE_MAJOR}`)
24+
return
25+
}
26+
2027
beforeEach(() => {
2128
tracer = require('../../dd-trace')
2229
})

packages/dd-trace/test/appsec/iast/analyzers/code-injection-analyzer.express.plugin.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict'
22

3+
const { NODE_MAJOR } = require('../../../../../../version')
4+
const semver = require('semver')
35
const { prepareTestServerForIastInExpress } = require('../utils')
46
const axios = require('axios')
57
const path = require('path')
@@ -14,6 +16,11 @@ const { withVersions } = require('../../../setup/mocha')
1416

1517
describe('Code injection vulnerability', () => {
1618
withVersions('express', 'express', version => {
19+
if (semver.intersects(version, '<=4.10.5') && NODE_MAJOR >= 24) {
20+
describe.skip(`refusing to run tests as express@${version} is incompatible with Node.js ${NODE_MAJOR}`)
21+
return
22+
}
23+
1724
describe('Eval', () => {
1825
let i = 0
1926
let evalFunctionsPath

packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
const { NODE_MAJOR } = require('../../../../../../../version')
34
const axios = require('axios')
45
const semver = require('semver')
56
const agent = require('../../../../plugins/agent')
@@ -19,6 +20,11 @@ describe('URI sourcing with express', () => {
1920
let appListener
2021

2122
withVersions('express', 'express', version => {
23+
if (semver.intersects(version, '<=4.10.5') && NODE_MAJOR >= 24) {
24+
describe.skip(`refusing to run tests as express@${version} is incompatible with Node.js ${NODE_MAJOR}`)
25+
return
26+
}
27+
2228
before(() => {
2329
return agent.load(['http', 'express'], { client: false })
2430
})
@@ -78,6 +84,11 @@ describe('Path params sourcing with express', () => {
7884
let appListener
7985

8086
withVersions('express', 'express', version => {
87+
if (semver.intersects(version, '<=4.10.5') && NODE_MAJOR >= 24) {
88+
describe.skip(`refusing to run tests as express@${version} is incompatible with Node.js ${NODE_MAJOR}`)
89+
return
90+
}
91+
8192
const checkParamIsTaintedAndNext = (req, res, next, param, name) => {
8293
const store = storage('legacy').getStore()
8394
const iastContext = iastContextFunctions.getIastContext(store)

packages/dd-trace/test/appsec/index.express.plugin.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict'
22

3+
const { NODE_MAJOR } = require('../../../../version')
4+
const semver = require('semver')
35
const Axios = require('axios')
46
const { assert } = require('chai')
57
const path = require('path')
@@ -11,6 +13,11 @@ const { json } = require('../../src/appsec/blocked_templates')
1113
const { withVersions } = require('../setup/mocha')
1214

1315
withVersions('express', 'express', version => {
16+
if (semver.intersects(version, '<=4.10.5') && NODE_MAJOR >= 24) {
17+
describe.skip(`refusing to run tests as express@${version} is incompatible with Node.js ${NODE_MAJOR}`)
18+
return
19+
}
20+
1421
describe('Suspicious request blocking - path parameters', () => {
1522
let server, paramCallbackSpy, axios
1623

packages/dd-trace/test/appsec/rasp/lfi.express.plugin.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict'
22

3+
const { NODE_MAJOR } = require('../../../../../version')
4+
const semver = require('semver')
35
const Axios = require('axios')
46
const os = require('os')
57
const fs = require('fs')
@@ -31,6 +33,11 @@ describe('RASP - lfi', () => {
3133
}
3234

3335
withVersions('express', 'express', expressVersion => {
36+
if (semver.intersects(expressVersion, '<=4.10.5') && NODE_MAJOR >= 24) {
37+
describe.skip(`refusing to run tests as express@${expressVersion} is incompatible with Node.js ${NODE_MAJOR}`)
38+
return
39+
}
40+
3441
withVersions('express', 'ejs', ejsVersion => {
3542
let app, server
3643

0 commit comments

Comments
 (0)