Skip to content

Commit de0d5bf

Browse files
committed
import cleanup from review feedback
1 parent aef400b commit de0d5bf

File tree

1 file changed

+8
-12
lines changed
  • plugins/node/opentelemetry-instrumentation-redis/test/v2-v3

1 file changed

+8
-12
lines changed

plugins/node/opentelemetry-instrumentation-redis/test/v2-v3/redis.test.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ import {
2424
ROOT_CONTEXT,
2525
} from '@opentelemetry/api';
2626
import * as testUtils from '@opentelemetry/contrib-test-utils';
27-
import {
28-
getTestSpans,
29-
registerInstrumentationTesting,
30-
} from '@opentelemetry/contrib-test-utils';
3127
import * as assert from 'assert';
3228
import { RedisInstrumentation } from '../../src';
3329
import {
@@ -39,7 +35,7 @@ import {
3935
SEMATTRS_NET_PEER_PORT,
4036
} from '@opentelemetry/semantic-conventions';
4137

42-
const instrumentation = registerInstrumentationTesting(
38+
const instrumentation = testUtils.registerInstrumentationTesting(
4339
new RedisInstrumentation()
4440
);
4541

@@ -184,9 +180,9 @@ describe('redis v2-v3', () => {
184180
context.with(trace.setSpan(context.active(), span), () => {
185181
operation.method((err, _result) => {
186182
assert.ifError(err);
187-
assert.strictEqual(getTestSpans().length, 1);
183+
assert.strictEqual(testUtils.getTestSpans().length, 1);
188184
span.end();
189-
const endedSpans = getTestSpans();
185+
const endedSpans = testUtils.getTestSpans();
190186
assert.strictEqual(endedSpans.length, 2);
191187
assert.strictEqual(
192188
endedSpans[0].name,
@@ -238,7 +234,7 @@ describe('redis v2-v3', () => {
238234
operation.method((err, _) => {
239235
assert.ifError(err);
240236
span.end();
241-
const endedSpans = getTestSpans();
237+
const endedSpans = testUtils.getTestSpans();
242238
assert.strictEqual(endedSpans.length, 2);
243239
const expectedStatement = dbStatementSerializer(
244240
operation.command,
@@ -276,7 +272,7 @@ describe('redis v2-v3', () => {
276272
it(`should apply responseHook for operation ${operation.description}`, done => {
277273
operation.method((err, reply) => {
278274
assert.ifError(err);
279-
const endedSpans = getTestSpans();
275+
const endedSpans = testUtils.getTestSpans();
280276
assert.strictEqual(
281277
endedSpans[0].attributes[dataFieldName],
282278
new String(reply).toString()
@@ -305,7 +301,7 @@ describe('redis v2-v3', () => {
305301
it(`should not fail because of responseHook error for operation ${operation.description}`, done => {
306302
operation.method((err, _reply) => {
307303
assert.ifError(err);
308-
const endedSpans = getTestSpans();
304+
const endedSpans = testUtils.getTestSpans();
309305
assert.strictEqual(endedSpans.length, 1);
310306
done();
311307
});
@@ -324,7 +320,7 @@ describe('redis v2-v3', () => {
324320
context.with(ROOT_CONTEXT, () => {
325321
operation.method((err, _) => {
326322
assert.ifError(err);
327-
const endedSpans = getTestSpans();
323+
const endedSpans = testUtils.getTestSpans();
328324
assert.strictEqual(endedSpans.length, 0);
329325
done();
330326
});
@@ -336,7 +332,7 @@ describe('redis v2-v3', () => {
336332
context.with(trace.setSpan(context.active(), span), () => {
337333
operation.method((err, _) => {
338334
assert.ifError(err);
339-
const endedSpans = getTestSpans();
335+
const endedSpans = testUtils.getTestSpans();
340336
assert.strictEqual(endedSpans.length, 1);
341337
done();
342338
});

0 commit comments

Comments
 (0)