Skip to content

Commit

Permalink
dbm tests use mocha version?
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed Feb 7, 2024
1 parent d0dfddf commit e691a99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions packages/datadog-plugin-mysql/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ describe('Plugin', () => {
connection.query('SELECT 1 + 1 AS solution', () => {
try {
expect(connection._protocol._queue[0].sql).to.equal(
`/*dddbs='serviced',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`/*dddbs='serviced',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand All @@ -333,7 +333,7 @@ describe('Plugin', () => {
connection.query('SELECT 1 + 1 AS solution', () => {
try {
expect(connection._protocol._queue[0].sql).to.equal(
`/*dddbs='db',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`/*dddbs='db',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand All @@ -347,7 +347,7 @@ describe('Plugin', () => {
connection.query('SELECT 1 + 1 AS solution', () => {
try {
expect(connection._protocol._queue[0].sql).to.equal(
`/*dddbs='remappedDB',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`/*dddbs='remappedDB',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand Down Expand Up @@ -375,7 +375,7 @@ describe('Plugin', () => {
connection.query('SELECT 1 + 1 AS solution', () => {
try {
expect(connection._protocol._queue[0].sql).to.equal(
`/*dddbs='serviced',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`/*dddbs='serviced',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand Down Expand Up @@ -422,7 +422,7 @@ describe('Plugin', () => {
try {
expect(connection._protocol._queue[0].sql).to.equal(
`/*dddbs='~!%40%23%24%25%5E%26*()_%2B%7C%3F%3F%2F%3C%3E',dde='tester',` +
`ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
done()
} catch (e) {
done(e)
Expand Down Expand Up @@ -459,7 +459,7 @@ describe('Plugin', () => {
const spanId = traces[0][0].span_id.toString(16).padStart(16, '0')

expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0',` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2',` +
`traceparent='00-${traceId}-${spanId}-00'*/ SELECT 1 + 1 AS solution`)
}).then(done, done)
const clock = sinon.useFakeTimers(new Date())
Expand Down Expand Up @@ -502,7 +502,7 @@ describe('Plugin', () => {
pool.query('SELECT 1 + 1 AS solution', () => {
try {
expect(pool._allConnections[0]._protocol._queue[0].sql).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand Down Expand Up @@ -539,7 +539,7 @@ describe('Plugin', () => {
const spanId = traces[0][0].span_id.toString(16).padStart(16, '0')

expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0',` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2',` +
`traceparent='00-${traceId}-${spanId}-00'*/ SELECT 1 + 1 AS solution`)
}).then(done, done)
const clock = sinon.useFakeTimers(new Date())
Expand Down
10 changes: 5 additions & 5 deletions packages/datadog-plugin-mysql2/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ describe('Plugin', () => {
const connect = connection.query('SELECT 1 + 1 AS solution', (...args) => {
try {
expect(connect.sql).to.equal(`/*dddbs='serviced',dde='tester',` +
`ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand Down Expand Up @@ -412,7 +412,7 @@ describe('Plugin', () => {
try {
expect(connect.sql).to.equal(
`/*dddbs='~!%40%23%24%25%5E%26*()_%2B%7C%3F%3F%2F%3C%3E',dde='tester',` +
`ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
done()
} catch (e) {
done(e)
Expand Down Expand Up @@ -449,7 +449,7 @@ describe('Plugin', () => {
const spanId = traces[0][0].span_id.toString(16).padStart(16, '0')

expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0',` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2',` +
`traceparent='00-${traceId}-${spanId}-00'*/ SELECT 1 + 1 AS solution`)
}).then(done, done)
const clock = sinon.useFakeTimers(new Date())
Expand Down Expand Up @@ -492,7 +492,7 @@ describe('Plugin', () => {
const queryPool = pool.query('SELECT 1 + 1 AS solution', () => {
try {
expect(queryPool.sql).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT 1 + 1 AS solution`)
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT 1 + 1 AS solution`)
} catch (e) {
done(e)
}
Expand Down Expand Up @@ -529,7 +529,7 @@ describe('Plugin', () => {
const spanId = traces[0][0].span_id.toString(16).padStart(16, '0')

expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0',` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2',` +
`traceparent='00-${traceId}-${spanId}-00'*/ SELECT 1 + 1 AS solution`)
}).then(done, done)
const clock = sinon.useFakeTimers(new Date())
Expand Down
12 changes: 6 additions & 6 deletions packages/datadog-plugin-pg/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ describe('Plugin', () => {
if (client.queryQueue[0] !== undefined) {
try {
expect(client.queryQueue[0].text).to.equal(
`/*dddbs='serviced',dde='tester',ddps='test',ddpv='8.4.0'*/ SELECT $1::text as message`)
`/*dddbs='serviced',dde='tester',ddps='test',ddpv='9.2.2'*/ SELECT $1::text as message`)
} catch (e) {
done(e)
}
Expand Down Expand Up @@ -429,7 +429,7 @@ describe('Plugin', () => {
try {
expect(clientDBM.queryQueue[0].text).to.equal(
`/*dddbs='~!%40%23%24%25%5E%26*()_%2B%7C%3F%3F%2F%3C%3E',dde='tester',` +
`ddps='test',ddpv='8.4.0'*/ SELECT $1::text as message`)
`ddps='test',ddpv='9.2.2'*/ SELECT $1::text as message`)
done()
} catch (e) {
done(e)
Expand Down Expand Up @@ -570,7 +570,7 @@ describe('Plugin', () => {
const spanId = traces[0][0].span_id.toString(16).padStart(16, '0')

expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0',` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2',` +
`traceparent='00-${traceId}-${spanId}-00'*/ SELECT $1::text as message`)
}).then(done, done)

Expand Down Expand Up @@ -616,7 +616,7 @@ describe('Plugin', () => {

agent.use(traces => {
expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0'` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2'` +
`*/ SELECT $1::text as message`)
}).then(done, done)

Expand All @@ -640,7 +640,7 @@ describe('Plugin', () => {

agent.use(traces => {
expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0'` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2'` +
`*/ SELECT $1::text as message`)
}).then(done, done)

Expand Down Expand Up @@ -674,7 +674,7 @@ describe('Plugin', () => {

agent.use(traces => {
expect(queryText).to.equal(
`/*dddbs='post',dde='tester',ddps='test',ddpv='8.4.0'` +
`/*dddbs='post',dde='tester',ddps='test',ddpv='9.2.2'` +
`*/ SELECT $1::text as greeting`)
}).then(done, done)

Expand Down

0 comments on commit e691a99

Please sign in to comment.