Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
76f5177
skipping unstable version
sabrenner Jul 26, 2022
d5df721
restricting upper bound semver
sabrenner Jul 26, 2022
04e1289
seeing if <3.2.0 works
sabrenner Jul 26, 2022
a60483b
restricting to all versions <4.0.0
sabrenner Jul 26, 2022
a5ff67d
cutting off 4.1.x completely
sabrenner Jul 26, 2022
1b0bd42
removing 3.2.x and 4.1.x
sabrenner Jul 26, 2022
b455a91
restricting to just 3.2.2
sabrenner Jul 26, 2022
6c8ef9c
reverting to all versions
sabrenner Jul 26, 2022
b3e98c8
changing image
sabrenner Jul 27, 2022
e73f4de
remove problematic versions from testing
sabrenner Jul 27, 2022
7438504
allowing 3.2.4 to run to test a version >=3.2.2
sabrenner Jul 28, 2022
0d119be
allowing 3.2.4 to run to test a version >=3.2.2
sabrenner Jul 28, 2022
ff1cfc3
ignoring only 3.2.2-3.2.4 on testing side
sabrenner Jul 28, 2022
49f14b4
making versions the same statement in hook
sabrenner Jul 28, 2022
ebc23c3
getting rid of couchbase as wipe exception
sabrenner Jul 28, 2022
5231db6
ignoring 4.1.x in tests
sabrenner Jul 28, 2022
602f626
back to ignoring 3.2.2-3.2.4 and 4.1.x
sabrenner Jul 28, 2022
c6c0b01
only ignore 4.1.x for logger issue
sabrenner Aug 3, 2022
ff38a4f
changing workflow to use node 14
sabrenner Aug 3, 2022
ef6cfd5
creating new job, wip
sabrenner Aug 3, 2022
e86b2ee
split plugin.yml
sabrenner Aug 5, 2022
5023aa6
using node 16 for v3
sabrenner Aug 5, 2022
977cc91
trying node12 again
sabrenner Aug 5, 2022
343e70a
adding semver restriction to instrumentation
sabrenner Aug 5, 2022
40600aa
using node16
sabrenner Aug 5, 2022
266b52b
wip
sabrenner Aug 8, 2022
1675386
wip
sabrenner Aug 8, 2022
56a286a
wip
sabrenner Aug 8, 2022
620c347
wip
sabrenner Aug 8, 2022
4d83779
wip
sabrenner Aug 8, 2022
4713828
merging in final testings and adding comment specifying why ignoring …
sabrenner Aug 8, 2022
0c435f1
cleanup wip
sabrenner Aug 11, 2022
036ce83
cleanup wip2
sabrenner Aug 11, 2022
22ac365
uncommenting instrumentations
sabrenner Aug 11, 2022
af854d6
ignoreMinVersion, refactoring
sabrenner Aug 15, 2022
25d7fa5
testing all versions
sabrenner Aug 15, 2022
2667ca3
resolve version issue
sabrenner Aug 15, 2022
08be629
testing changes
sabrenner Aug 16, 2022
96a06b5
refactoring removeVersions
sabrenner Aug 16, 2022
2ff2a3e
wip
sabrenner Aug 17, 2022
f04c403
re-adding versions to externals
sabrenner Aug 17, 2022
51086b1
cleanup
sabrenner Aug 17, 2022
9a4c59c
Merge branch 'master' into sabrenner/couchbasesegfaultfix
sabrenner Aug 17, 2022
bdc94f5
removing useless envvar from workflow
sabrenner Aug 17, 2022
2300565
Merge branch 'sabrenner/couchbasesegfaultfix' of github.com:DataDog/d…
sabrenner Aug 17, 2022
ed12613
removing v2 workflow
sabrenner Aug 17, 2022
ea2b7fb
adding node16 to workflow
sabrenner Aug 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,26 @@ jobs:
- run: yarn test:plugins:ci
- uses: codecov/codecov-action@v2

# couchbase:
# runs-on: ubuntu-latest
# services:
# couchbase:
# image: sabrenner/couchbase-server-sandbox:latest
# ports:
# - 8091-8095:8091-8095
# - 11210:11210
# env:
# PLUGINS: couchbase
# SERVICES: couchbase
# steps:
# - uses: actions/checkout@v2
# - uses: ./.github/actions/node/setup
# - run: yarn install
# - uses: ./.github/actions/node/oldest
# - run: yarn test:plugins:ci
# - uses: codecov/codecov-action@v2
couchbase:
runs-on: ubuntu-latest
services:
couchbase:
image: sabrenner/couchbase-server-sandbox:sandbox
ports:
- 8091-8095:8091-8095
- 11210:11210
env:
PLUGINS: couchbase
SERVICES: couchbase
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/node/setup
- run: yarn install
- uses: ./.github/actions/node/14
- run: yarn test:plugins:ci
- uses: ./.github/actions/node/16
- run: yarn test:plugins:ci
- uses: codecov/codecov-action@v2

connect:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "2"
services:
couchbase:
image: sabrenner/couchbase-server-sandbox:latest
image: sabrenner/couchbase-server-sandbox:sandbox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the sandbox tag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a different version of the image I pushed up. It uses a different parent image, but I wanted to keep the other one in the case that it could still be useful, so I just named this one something different.

ports:
- "127.0.0.1:8091-8095:8091-8095"
- "127.0.0.1:11210:11210"
Expand Down
10 changes: 8 additions & 2 deletions packages/datadog-instrumentations/src/couchbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ addHook({ name: 'couchbase', file: 'lib/cluster.js', versions: ['>=3.0.0 <3.2.0'

// semver >=3.2.0

addHook({ name: 'couchbase', file: 'dist/collection.js', versions: ['>=3.2.0'] }, collection => {
addHook({
name: 'couchbase',
file: 'dist/collection.js',
versions: ['>=3.2.0'] }, collection => {
const Collection = collection.Collection

wrapAllNames(['upsert', 'insert', 'replace'], name => {
Expand All @@ -242,7 +245,10 @@ addHook({ name: 'couchbase', file: 'dist/collection.js', versions: ['>=3.2.0'] }
return collection
})

addHook({ name: 'couchbase', file: 'dist/cluster.js', versions: ['3.2.0 - 3.2.1', '>=3.2.2'] }, cluster => {
addHook({
name: 'couchbase',
file: 'dist/cluster.js',
versions: ['>=3.2.0'] }, cluster => {
const Cluster = cluster.Cluster

shimmer.wrap(Cluster.prototype, 'query', wrapV3Query)
Expand Down
5 changes: 1 addition & 4 deletions packages/datadog-plugin-couchbase/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('Plugin', () => {
let cluster
let bucket
let tracer
let collection

before(() => {
tracer = global.tracer = require('../../dd-trace')
Expand Down Expand Up @@ -150,9 +149,7 @@ describe('Plugin', () => {
})

withVersions('couchbase', 'couchbase', '>=3.0.0', version => {
beforeEach(() => {
tracer = global.tracer = require('../../dd-trace')
})
let collection

describe('without configuration', () => {
beforeEach(done => {
Expand Down
18 changes: 18 additions & 0 deletions packages/dd-trace/test/plugins/externals.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
{
"couchbase": [
{
"name": "couchbase",
"versions": ["^2.6.5"],
"nodeVersions": ["<14.0.0"]
},
{
"name": "couchbase",
"versions": [">=3.0.0 <3.2.0", "3.2.0 - 3.2.1", "3.2.2 - 3.2.4"],
"nodeVersions": [">=14.0.0"]
},
{
"name": "couchbase",
"versions": [">=4.0.0"],
"nodeVersions": [">=14.0.0"],
"ignoreMinVersion": true
}
],
"cypress": [
{
"name": "cypress",
Expand Down
27 changes: 23 additions & 4 deletions packages/dd-trace/test/setup/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,34 @@ function loadInstFile (file, instrumentations) {
}

function withVersions (plugin, modules, range, cb) {
const instrumentations = typeof plugin === 'string' ? loadInst(plugin) : [].concat(plugin)
let instrumentations = typeof plugin === 'string' ? loadInst(plugin) : [].concat(plugin)
const names = instrumentations.map(instrumentation => instrumentation.name)

modules = [].concat(modules)

names.forEach(name => {
if (externals[name]) {
[].concat(externals[name]).forEach(external => {
instrumentations.push(external)
const { nodeVersions } = external
const satisfies = nodeVersions
? nodeVersions
.reduce((satisfies, version) => satisfies || semver.satisfies(process.version, version), false)
: true

if (satisfies) {
// use external in instrumentation
instrumentations.push(external)
} else {
// don't add this external, and remove all other instrumentations from testing with overlapping versions
instrumentations = instrumentations.filter(instrumentation => {
return instrumentation.versions.reduce((matches, instVersion) => {
external.versions.forEach(extVersion => {
matches = matches && !semver.intersects(instVersion, extVersion)
})
return matches
}, true)
})
}
})
}
})
Expand All @@ -89,8 +108,8 @@ function withVersions (plugin, modules, range, cb) {
.forEach(version => {
const min = semver.coerce(version).version
const max = require(`../../../../versions/${moduleName}@${version}`).version()

testVersions.set(min, { range: version, test: min })
// temporary work-around for issues with testing multiple versions within a range
if (!instrumentation.ignoreMinVersion) testVersions.set(min, { range: version, test: min })
testVersions.set(max, { range: version, test: version })
})
})
Expand Down