Skip to content

Commit 08be629

Browse files
committed
testing changes
1 parent 2667ca3 commit 08be629

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

packages/dd-trace/test/plugins/externals.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
{
99
"name": "couchbase",
1010
"versions": [">=3.0.0 <3.2.0", "3.2.0 - 3.2.1", "3.2.2 - 3.2.4"],
11-
"nodeVersions": [">=14.0.0"]
11+
"nodeVersions": [">=14.0.0 <18.0.0"]
1212
},
1313
{
1414
"name": "couchbase",
1515
"versions": [">=4.0.0"],
16-
"nodeVersions": [">=14.0.0"],
16+
"nodeVersions": [">=14.0.0 <18.0.0"],
1717
"ignoreMinVersion": true
1818
}
1919
],

packages/dd-trace/test/setup/core.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ function loadInstFile (file, instrumentations) {
6060
})
6161
}
6262

63-
function removeVersions (instrumentations, external) {
64-
let idx = 0
65-
while (idx < instrumentations.length) {
66-
const inst = instrumentations[idx]
67-
if (JSON.stringify(inst.versions) === JSON.stringify(external.versions)) {
68-
instrumentations.splice(idx, 1)
69-
} else {
70-
idx++
71-
}
72-
}
63+
function removeVersions (instrumentations = [], external) {
64+
instrumentations.forEach((instrumentation, index) => {
65+
instrumentation.versions.forEach(instVersion => {
66+
external.versions.forEach(externalVersion => {
67+
if (semver.intersects(instVersion, externalVersion)) {
68+
delete instrumentations[index]
69+
}
70+
})
71+
})
72+
})
7373
}
7474

7575
function withVersions (plugin, modules, range, cb) {
@@ -112,6 +112,7 @@ function withVersions (plugin, modules, range, cb) {
112112
const testVersions = new Map()
113113

114114
instrumentations
115+
.filter(Boolean)
115116
.filter(instrumentation => instrumentation.name === moduleName)
116117
.forEach(instrumentation => {
117118
instrumentation.versions

0 commit comments

Comments
 (0)