From 69efe64cf1cf5e0ca2abc832248d4916475a4db4 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Fri, 17 Jun 2022 21:12:02 +0300 Subject: [PATCH] test: make the integer obvious in mysql tests (#1061) --- .../test/mysql.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/test/mysql.test.ts b/plugins/node/opentelemetry-instrumentation-mysql2/test/mysql.test.ts index 6bbefce3a9..3874ccf177 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/test/mysql.test.ts +++ b/plugins/node/opentelemetry-instrumentation-mysql2/test/mysql.test.ts @@ -382,11 +382,11 @@ describe('mysql@2.x', () => { it('should intercept connection.execute(text: string, values: [], callback)', done => { const span = provider.getTracer('default').startSpan('test span'); context.with(trace.setSpan(context.active(), span), () => { - const sql = 'SELECT ? as solution'; + const sql = 'SELECT 1+? as solution'; connection.execute(sql, [1], (err, res: mysqlTypes.RowDataPacket[]) => { assert.ifError(err); assert.ok(res); - assert.strictEqual(res[0].solution, 1); + assert.strictEqual(res[0].solution, 2); const spans = memoryExporter.getFinishedSpans(); assert.strictEqual(spans.length, 1); assertSpan(spans[0], sql, [1]); @@ -398,11 +398,11 @@ describe('mysql@2.x', () => { it('should intercept connection.execute(text: string, value: any, callback)', done => { const span = provider.getTracer('default').startSpan('test span'); context.with(trace.setSpan(context.active(), span), () => { - const sql = 'SELECT ? as solution'; + const sql = 'SELECT 1+? as solution'; connection.execute(sql, [1], (err, res: mysqlTypes.RowDataPacket[]) => { assert.ifError(err); assert.ok(res); - assert.strictEqual(res[0].solution, 1); + assert.strictEqual(res[0].solution, 2); const spans = memoryExporter.getFinishedSpans(); assert.strictEqual(spans.length, 1); assertSpan(spans[0], sql, [1]); @@ -701,11 +701,11 @@ describe('mysql@2.x', () => { it('should intercept pool.execute(text: string, values: [], callback)', done => { const span = provider.getTracer('default').startSpan('test span'); context.with(trace.setSpan(context.active(), span), () => { - const sql = 'SELECT ? as solution'; + const sql = 'SELECT 1+? as solution'; pool.execute(sql, [1], (err, res: mysqlTypes.RowDataPacket[]) => { assert.ifError(err); assert.ok(res); - assert.strictEqual(res[0].solution, 1); + assert.strictEqual(res[0].solution, 2); const spans = memoryExporter.getFinishedSpans(); assert.strictEqual(spans.length, 1); assertSpan(spans[0], sql, [1]); @@ -717,11 +717,11 @@ describe('mysql@2.x', () => { it('should intercept pool.execute(text: string, value: any, callback)', done => { const span = provider.getTracer('default').startSpan('test span'); context.with(trace.setSpan(context.active(), span), () => { - const sql = 'SELECT ? as solution'; + const sql = 'SELECT 1+? as solution'; pool.execute(sql, [1], (err, res: mysqlTypes.RowDataPacket[]) => { assert.ifError(err); assert.ok(res); - assert.strictEqual(res[0].solution, 1); + assert.strictEqual(res[0].solution, 2); const spans = memoryExporter.getFinishedSpans(); assert.strictEqual(spans.length, 1); assertSpan(spans[0], sql, [1]);