Skip to content

Commit 212c440

Browse files
authored
Re-enable Couchbase testing (#3265)
* Couchbase: Update Docker Container repo This repo uses a slightly modified version of the Couchbase docker image for testing. This modified version is required to do some base configuration of the Couchbase container (such as password setup, memory settings, and more). Prior to this change, we used a container image/repo owned by Sam Brenner (sabrenner). This change forks the sabrenner repository and adds the container to DataDog's github container repository. * Couchbase: update tested versions This change updates several of the versions of Couchbase which we test against. In particular: * 2.6.12 replaces 2.6.5 due to an inability to compile 2.6.5 in the latest Node releases * 3.0.7 replaces 3.0.0 due to test timeout issues causing flakiness * 3.1.2 replaces 3.1.0 due to test timeout issues causing flakiness These changes put the couchbase dependency in a state where it can be re-introduced to the CI tests. * Couchbase: Re-enable testing Prior to this change, Couchbase tests were disabled due to constant failures and flaky tests. Recent changes have fixed the testing issues by: * Upgrading Couchbase server from 6.0.1 to 6.6.5 * Updating the versions of Couchbase client we use to test This change re-enables testing the Couchbase integration now that tests are working and stable.
1 parent 32c6646 commit 212c440

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

.github/workflows/plugins.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -182,24 +182,25 @@ jobs:
182182
uses: ./.github/actions/testagent/logs
183183
- uses: codecov/codecov-action@v2
184184

185-
# couchbase:
186-
# runs-on: ubuntu-latest
187-
# services:
188-
# couchbase:
189-
# image: sabrenner/couchbase-server-sandbox:latest
190-
# ports:
191-
# - 8091-8095:8091-8095
192-
# - 11210:11210
193-
# env:
194-
# PLUGINS: couchbase
195-
# SERVICES: couchbase
196-
# steps:
197-
# - uses: actions/checkout@v2
198-
# - uses: ./.github/actions/node/setup
199-
# - run: yarn install
200-
# - uses: ./.github/actions/node/oldest
201-
# - run: yarn test:plugins:ci
202-
# - uses: codecov/codecov-action@v2
185+
couchbase:
186+
runs-on: ubuntu-latest
187+
services:
188+
couchbase:
189+
image: ghcr.io/datadog/couchbase-server-sandbox:latest
190+
ports:
191+
- 8091-8095:8091-8095
192+
- 11210:11210
193+
env:
194+
PLUGINS: couchbase
195+
SERVICES: couchbase
196+
steps:
197+
- uses: actions/checkout@v2
198+
- uses: ./.github/actions/testagent/start
199+
- uses: ./.github/actions/node/setup
200+
- run: yarn install
201+
- uses: ./.github/actions/node/oldest
202+
- run: yarn test:plugins:ci
203+
- uses: codecov/codecov-action@v2
203204

204205
connect:
205206
runs-on: ubuntu-latest

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "2"
22
services:
33
couchbase:
4-
image: sabrenner/couchbase-server-sandbox:latest
4+
image: ghcr.io/datadog/couchbase-server-sandbox:latest
55
ports:
66
- "127.0.0.1:8091-8095:8091-8095"
77
- "127.0.0.1:11210:11210"

packages/datadog-instrumentations/src/couchbase.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function wrapV3Query (query) {
160160
}
161161

162162
// semver >=2 <3
163-
addHook({ name: 'couchbase', file: 'lib/bucket.js', versions: ['^2.6.5'] }, Bucket => {
163+
addHook({ name: 'couchbase', file: 'lib/bucket.js', versions: ['^2.6.12'] }, Bucket => {
164164
const startCh = channel('apm:couchbase:query:start')
165165
const finishCh = channel('apm:couchbase:query:finish')
166166
const errorCh = channel('apm:couchbase:query:error')
@@ -208,7 +208,7 @@ addHook({ name: 'couchbase', file: 'lib/bucket.js', versions: ['^2.6.5'] }, Buck
208208
return Bucket
209209
})
210210

211-
addHook({ name: 'couchbase', file: 'lib/cluster.js', versions: ['^2.6.5'] }, Cluster => {
211+
addHook({ name: 'couchbase', file: 'lib/cluster.js', versions: ['^2.6.12'] }, Cluster => {
212212
Cluster.prototype._maybeInvoke = wrapMaybeInvoke(Cluster.prototype._maybeInvoke)
213213
Cluster.prototype.query = wrapQuery(Cluster.prototype.query)
214214

@@ -217,15 +217,15 @@ addHook({ name: 'couchbase', file: 'lib/cluster.js', versions: ['^2.6.5'] }, Clu
217217

218218
// semver >=3 <3.2.0
219219

220-
addHook({ name: 'couchbase', file: 'lib/collection.js', versions: ['>=3.0.0 <3.2.0'] }, Collection => {
220+
addHook({ name: 'couchbase', file: 'lib/collection.js', versions: ['^3.0.7', '^3.1.3'] }, Collection => {
221221
wrapAllNames(['upsert', 'insert', 'replace'], name => {
222222
shimmer.wrap(Collection.prototype, name, wrapWithName(name))
223223
})
224224

225225
return Collection
226226
})
227227

228-
addHook({ name: 'couchbase', file: 'lib/cluster.js', versions: ['>=3.0.0 <3.2.0'] }, Cluster => {
228+
addHook({ name: 'couchbase', file: 'lib/cluster.js', versions: ['^3.0.7', '^3.1.3'] }, Cluster => {
229229
shimmer.wrap(Cluster.prototype, 'query', wrapV3Query)
230230
return Cluster
231231
})

scripts/install_plugin_modules.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const externals = require('../packages/dd-trace/test/plugins/externals')
1212

1313
const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json')
1414

15+
// Can remove couchbase after removing support for couchbase <= 3.2.0
1516
const excludeList = os.arch() === 'arm64' ? ['couchbase', 'grpc', 'oracledb'] : []
1617
const workspaces = new Set()
1718
const versionLists = {}

0 commit comments

Comments
 (0)