From 5b74a44dcf7edf37e79bd5a0fef06146049f4718 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Mon, 18 Sep 2023 11:39:25 -0700 Subject: [PATCH 01/11] SNOW-728803: Do not replace sqlText if it is specified by the user --- lib/connection/statement.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/connection/statement.js b/lib/connection/statement.js index 6adbca25e..bb70de8df 100644 --- a/lib/connection/statement.js +++ b/lib/connection/statement.js @@ -1300,11 +1300,9 @@ function sendRequestPreExec(statementContext, onResultAvailable) { disableOfflineChunks: false, }; - if (!statementContext.resubmitRequest) - { - json.sqlText = statementContext.sqlText; - } - else + json.sqlText = statementContext.sqlText; + + if (statementContext.resubmitRequest && !json.sqlText) { json.sqlText = `SELECT 'Error retrieving query results for request id: ${statementContext.requestId}, ` + `please use RESULT_SCAN instead' AS ErrorMessage;`; From 3870a8787d6413b158e36ad3105c790ea9f98522 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Tue, 19 Sep 2023 15:01:42 -0700 Subject: [PATCH 02/11] SNOW-728803: Reformat with eslint --- lib/connection/statement.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/connection/statement.js b/lib/connection/statement.js index bb70de8df..baff69682 100644 --- a/lib/connection/statement.js +++ b/lib/connection/statement.js @@ -1302,8 +1302,7 @@ function sendRequestPreExec(statementContext, onResultAvailable) }; json.sqlText = statementContext.sqlText; - if (statementContext.resubmitRequest && !json.sqlText) - { + if (statementContext.resubmitRequest && !json.sqlText) { json.sqlText = `SELECT 'Error retrieving query results for request id: ${statementContext.requestId}, ` + `please use RESULT_SCAN instead' AS ErrorMessage;`; } From 2f6a4abfe6089f78aa8ede769c3159af0ff2a635 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Thu, 21 Sep 2023 14:48:38 -0700 Subject: [PATCH 03/11] SNOW-728803: Add test for special case when resubmitting requets --- lib/connection/statement.js | 6 ++ test/unit/mock/mock_http_client.js | 105 +++++++++++++++++++++++++++++ test/unit/snowflake_test.js | 65 ++++++++++++++++++ 3 files changed, 176 insertions(+) diff --git a/lib/connection/statement.js b/lib/connection/statement.js index baff69682..d8d8e46c1 100644 --- a/lib/connection/statement.js +++ b/lib/connection/statement.js @@ -420,6 +420,12 @@ function createContextPreExec( { statementContext.requestId = statementOptions.requestId; } + + // SNOW-728803: In QA mode, set resubmitRequest to true to test that sqlText + // is not overwritten if a sqlText is already specified by the user + if (statementOptions.requestId === 'SNOW-728803-requestId') { + statementContext.resubmitRequest = true; + } } return statementContext; diff --git a/test/unit/mock/mock_http_client.js b/test/unit/mock/mock_http_client.js index cfefe231a..483c337ff 100644 --- a/test/unit/mock/mock_http_client.js +++ b/test/unit/mock/mock_http_client.js @@ -697,6 +697,111 @@ function buildRequestOutputMappings(clientInfo) } } }, + { + request: + { + method: 'POST', + url: 'http://fakeaccount.snowflakecomputing.com/queries/v1/query-request?requestId=', + headers: + { + 'Accept': 'application/snowflake', + 'Authorization': 'Snowflake Token="SESSION_TOKEN"', + 'Content-Type': 'application/json' + }, + json: + { + disableOfflineChunks: false, + sqlText: 'select 1;' + } + }, + output: + { + err: null, + response: + { + statusCode: 401, + statusMessage: 'Unauthorized', + body: + { + 'data' : null, + 'code': '390103', + 'message': 'Session token not found in the request data.', + 'success': false, + } + } + } + }, + { + request: + { + method: 'POST', + url: 'http://fakeaccount.snowflakecomputing.com/queries/v1/query-request?requestId=SNOW-728803-requestId', + headers: + { + 'Accept': 'application/snowflake', + 'Authorization': 'Snowflake Token="SESSION_TOKEN"', + 'Content-Type': 'application/json' + }, + json: + { + disableOfflineChunks: false, + sqlText: 'SELECT \'Error retrieving query results for request id: SNOW-728803-requestId, please use RESULT_SCAN instead\' AS ErrorMessage;' + } + }, + output: + { + err: null, + response: + { + body: + { + 'message': 'The specified sqlText should not be overwritten when resubmitting the request', + 'success': false + } + } + } + }, + { + request: + { + method: 'POST', + url: 'http://fakeaccount.snowflakecomputing.com/queries/v1/query-request?requestId=SNOW-728803-requestId', + headers: + { + 'Accept': 'application/snowflake', + 'Authorization': 'Snowflake Token="SESSION_TOKEN"', + 'Content-Type': 'application/json' + }, + json: + { + disableOfflineChunks: false, + sqlText: 'select 1;' + } + }, + output: + { + err: null, + response: + { + statusCode: 200, + statusMessage: 'OK', + body: + { + 'data': + { + 'parameters': [], + 'rowtype': [], + 'rowset': [['1']], + 'total': 1, + 'returned': 1 + }, + 'message': null, + 'code': null, + 'success': true + } + } + } + }, { request: { diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index a50c7de05..8bb6d7afd 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -936,6 +936,71 @@ describe('connection.execute() statement failure', function () }); }); +describe('connection.execute() with requestId', function () { + const connection = snowflake.createConnection(connectionOptions); + const sqlText = 'select 1;'; + const requestId = 'SNOW-728803-requestId'; + + it('keep original sqlText when resubmitting requests', function (done) { + let statement; + + async.series( + [ + function (callback) { + connection.connect(function (err, conn) { + assert.ok(!err, 'there should be no error'); + assert.strictEqual(conn, connection, + 'the connect() callback should be invoked with the statement'); + + callback(); + }); + }, + function (callback) { + // 1st request fails with an error + statement = connection.execute( + { + sqlText: sqlText, + complete: function (err, stmt) { + assert.ok(err, 'there should be an error'); + assert.strictEqual(stmt, statement, + 'the execute() callback should be invoked with the statement'); + + callback(); + } + }); + }, + function (callback) { + // 2nd request with sqlText and requestId specified + statement = connection.execute( + { + sqlText: sqlText, + requestId: requestId, + complete: function (err, stmt) { + // if there's an error, fail the test with the error + if (err) { + done(err); + } + + assert.ok(!err, 'there should be no error'); + assert.strictEqual(stmt, statement, + 'the execute() callback should be invoked with the statement'); + + callback(); + } + }); + + // the sql text and request id should be the same as what was passed + // in + assert.strictEqual(statement.getSqlText(), sqlText); + assert.strictEqual(statement.getRequestId(), requestId); + } + ], + function () { + done(); + }); + }); +}); + describe('too many concurrent requests', function () { it('too many concurrent requests per user', function (done) From fefa652e666971ec0fd442bd9bda2350e64c73f7 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Fri, 22 Sep 2023 15:45:27 -0700 Subject: [PATCH 04/11] SNOW-728803: Modify request to include queryContextDTO property --- test/unit/mock/mock_http_client.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/unit/mock/mock_http_client.js b/test/unit/mock/mock_http_client.js index 7cdd6a90c..579d58f68 100644 --- a/test/unit/mock/mock_http_client.js +++ b/test/unit/mock/mock_http_client.js @@ -714,7 +714,8 @@ function buildRequestOutputMappings(clientInfo) json: { disableOfflineChunks: false, - sqlText: 'select 1;' + sqlText: 'select 1;', + queryContextDTO: { entries: [] } } }, output: @@ -748,7 +749,8 @@ function buildRequestOutputMappings(clientInfo) json: { disableOfflineChunks: false, - sqlText: 'SELECT \'Error retrieving query results for request id: SNOW-728803-requestId, please use RESULT_SCAN instead\' AS ErrorMessage;' + sqlText: 'SELECT \'Error retrieving query results for request id: SNOW-728803-requestId, please use RESULT_SCAN instead\' AS ErrorMessage;', + queryContextDTO: { entries: [] } } }, output: @@ -778,7 +780,8 @@ function buildRequestOutputMappings(clientInfo) json: { disableOfflineChunks: false, - sqlText: 'select 1;' + sqlText: 'select 1;', + queryContextDTO: { entries: [] } } }, output: From 67d5f4cf7427b474dafff4a9b037f67830f69d4f Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Mon, 25 Sep 2023 15:21:00 -0700 Subject: [PATCH 05/11] SNOW-728803: Replace done(err) with callback(err) --- test/unit/snowflake_test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index 8bb6d7afd..4cc032d50 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -978,7 +978,7 @@ describe('connection.execute() with requestId', function () { complete: function (err, stmt) { // if there's an error, fail the test with the error if (err) { - done(err); + callback(err); } assert.ok(!err, 'there should be no error'); @@ -995,8 +995,8 @@ describe('connection.execute() with requestId', function () { assert.strictEqual(statement.getRequestId(), requestId); } ], - function () { - done(); + function (err) { + done(err); }); }); }); From 5fc404a1dd72b19bee363c1db6ebee8d3c76524c Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Mon, 25 Sep 2023 15:23:46 -0700 Subject: [PATCH 06/11] SNOW-728803: Wrap in else clause --- test/unit/snowflake_test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index 4cc032d50..06edd2422 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -980,12 +980,13 @@ describe('connection.execute() with requestId', function () { if (err) { callback(err); } + else { + assert.ok(!err, 'there should be no error'); + assert.strictEqual(stmt, statement, + 'the execute() callback should be invoked with the statement'); - assert.ok(!err, 'there should be no error'); - assert.strictEqual(stmt, statement, - 'the execute() callback should be invoked with the statement'); - - callback(); + callback(); + } } }); From 21f70448027b12ba4ccd1924d3bd6903f459fe3e Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Wed, 27 Sep 2023 15:29:09 -0700 Subject: [PATCH 07/11] SNOW-728803: Set requestId the same for QA and non-QA mode --- lib/connection/statement.js | 35 ++++------------- test/unit/mock/mock_http_client.js | 63 +++++++----------------------- test/unit/snowflake_test.js | 16 +------- 3 files changed, 22 insertions(+), 92 deletions(-) diff --git a/lib/connection/statement.js b/lib/connection/statement.js index 980b402d1..130d6bc30 100644 --- a/lib/connection/statement.js +++ b/lib/connection/statement.js @@ -397,35 +397,14 @@ function createContextPreExec( Errors.assertInternal(Util.isObject(services)); Errors.assertInternal(Util.isObject(connectionConfig)); - // if we're not in qa mode, use a random uuid for the statement request id - // or use request id passed by user - if (!connectionConfig.isQaMode()) - { - if (statementOptions.requestId) - { - statementContext.requestId = statementOptions.requestId; - statementContext.resubmitRequest = true; - } - else - { - statementContext.requestId = uuidv4(); - } + // use request id passed by user + if (statementOptions.requestId) { + statementContext.requestId = statementOptions.requestId; + statementContext.resubmitRequest = true; } - else // we're in qa mode - { - // if a request id or sequence id are specified in the statement options, - // use them as is; this is to facilitate testing by making things more - // deterministic - if (Util.isString(statementOptions.requestId)) - { - statementContext.requestId = statementOptions.requestId; - } - - // SNOW-728803: In QA mode, set resubmitRequest to true to test that sqlText - // is not overwritten if a sqlText is already specified by the user - if (statementOptions.requestId === 'SNOW-728803-requestId') { - statementContext.resubmitRequest = true; - } + else { + // use a random uuid for the statement request id + statementContext.requestId = uuidv4(); } return statementContext; diff --git a/test/unit/mock/mock_http_client.js b/test/unit/mock/mock_http_client.js index 579d58f68..0f9e7c5bc 100644 --- a/test/unit/mock/mock_http_client.js +++ b/test/unit/mock/mock_http_client.js @@ -704,7 +704,7 @@ function buildRequestOutputMappings(clientInfo) request: { method: 'POST', - url: 'http://fakeaccount.snowflakecomputing.com/queries/v1/query-request?requestId=', + url: 'http://fakeaccount.snowflakecomputing.com/queries/v1/query-request?requestId=SNOW-728803-requestId', headers: { 'Accept': 'application/snowflake', @@ -723,14 +723,21 @@ function buildRequestOutputMappings(clientInfo) err: null, response: { - statusCode: 401, - statusMessage: 'Unauthorized', + statusCode: 200, + statusMessage: 'OK', body: { - 'data' : null, - 'code': '390103', - 'message': 'Session token not found in the request data.', - 'success': false, + 'data': + { + 'parameters': [], + 'rowtype': [], + 'rowset': [['1']], + 'total': 1, + 'returned': 1 + }, + 'message': null, + 'code': null, + 'success': true } } } @@ -766,48 +773,6 @@ function buildRequestOutputMappings(clientInfo) } } }, - { - request: - { - method: 'POST', - url: 'http://fakeaccount.snowflakecomputing.com/queries/v1/query-request?requestId=SNOW-728803-requestId', - headers: - { - 'Accept': 'application/snowflake', - 'Authorization': 'Snowflake Token="SESSION_TOKEN"', - 'Content-Type': 'application/json' - }, - json: - { - disableOfflineChunks: false, - sqlText: 'select 1;', - queryContextDTO: { entries: [] } - } - }, - output: - { - err: null, - response: - { - statusCode: 200, - statusMessage: 'OK', - body: - { - 'data': - { - 'parameters': [], - 'rowtype': [], - 'rowset': [['1']], - 'total': 1, - 'returned': 1 - }, - 'message': null, - 'code': null, - 'success': true - } - } - } - }, { request: { diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index 06edd2422..29c02410d 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -956,21 +956,7 @@ describe('connection.execute() with requestId', function () { }); }, function (callback) { - // 1st request fails with an error - statement = connection.execute( - { - sqlText: sqlText, - complete: function (err, stmt) { - assert.ok(err, 'there should be an error'); - assert.strictEqual(stmt, statement, - 'the execute() callback should be invoked with the statement'); - - callback(); - } - }); - }, - function (callback) { - // 2nd request with sqlText and requestId specified + // request with sqlText and requestId specified statement = connection.execute( { sqlText: sqlText, From 3d17073c51c8f9194b39daf66701ab76192602ab Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Wed, 27 Sep 2023 16:03:33 -0700 Subject: [PATCH 08/11] SNOW-728803: Fix spacing of bracket --- test/unit/mock/mock_http_client.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unit/mock/mock_http_client.js b/test/unit/mock/mock_http_client.js index 0f9e7c5bc..05d3c346b 100644 --- a/test/unit/mock/mock_http_client.js +++ b/test/unit/mock/mock_http_client.js @@ -728,13 +728,13 @@ function buildRequestOutputMappings(clientInfo) body: { 'data': - { - 'parameters': [], - 'rowtype': [], - 'rowset': [['1']], - 'total': 1, - 'returned': 1 - }, + { + 'parameters': [], + 'rowtype': [], + 'rowset': [['1']], + 'total': 1, + 'returned': 1 + }, 'message': null, 'code': null, 'success': true From 86e9076afa13ffbd65ce69adcd766ea0311b9059 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Thu, 28 Sep 2023 13:21:40 -0700 Subject: [PATCH 09/11] SNOW-728803: Add test case for sqlText being overwritten --- test/unit/snowflake_test.js | 46 +++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index 29c02410d..85d43909e 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -941,9 +941,7 @@ describe('connection.execute() with requestId', function () { const sqlText = 'select 1;'; const requestId = 'SNOW-728803-requestId'; - it('keep original sqlText when resubmitting requests', function (done) { - let statement; - + before(function (done) { async.series( [ function (callback) { @@ -954,7 +952,17 @@ describe('connection.execute() with requestId', function () { callback(); }); - }, + } + ], + done + ); + }); + + it('keep original sqlText when resubmitting requests', function (done) { + let statement; + + async.series( + [ function (callback) { // request with sqlText and requestId specified statement = connection.execute( @@ -986,6 +994,36 @@ describe('connection.execute() with requestId', function () { done(err); }); }); + + it('sqlText is overwritten when resubmitting requests', function (done) { + let statement; + + async.series( + [ + function (callback) { + // request with only requestId specified + statement = connection.execute( + { + // intentionally leave sqlText blank to invoke the connector to overwrite the sqlText + sqlText: '', + requestId: requestId, + complete: function (err, stmt) { + assert.ok(err, 'there should be an error'); + assert.strictEqual(stmt, statement, + 'the execute() callback should be invoked with the statement'); + + callback(); + } + }); + + // the request id should be the same as what was passed in + assert.strictEqual(statement.getRequestId(), requestId); + } + ], + function (err) { + done(err); + }); + }); }); describe('too many concurrent requests', function () From 7d4b23c8214b1d18191576b0d3ced6e83c32261b Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Fri, 29 Sep 2023 11:58:58 -0700 Subject: [PATCH 10/11] SNOW-728803: Clean up tests --- test/unit/snowflake_test.js | 49 ++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index 85d43909e..603e38fc2 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -939,33 +939,25 @@ describe('connection.execute() statement failure', function () describe('connection.execute() with requestId', function () { const connection = snowflake.createConnection(connectionOptions); const sqlText = 'select 1;'; + const blankSqlText = ''; const requestId = 'SNOW-728803-requestId'; before(function (done) { - async.series( - [ - function (callback) { - connection.connect(function (err, conn) { - assert.ok(!err, 'there should be no error'); - assert.strictEqual(conn, connection, - 'the connect() callback should be invoked with the statement'); + connection.connect(function (err, conn) { + assert.ok(!err, 'there should be no error'); + assert.strictEqual(conn, connection, + 'the connect() callback should be invoked with the statement'); - callback(); - }); - } - ], - done - ); + done(); + }); }); it('keep original sqlText when resubmitting requests', function (done) { - let statement; - async.series( [ function (callback) { // request with sqlText and requestId specified - statement = connection.execute( + const statement = connection.execute( { sqlText: sqlText, requestId: requestId, @@ -979,15 +971,15 @@ describe('connection.execute() with requestId', function () { assert.strictEqual(stmt, statement, 'the execute() callback should be invoked with the statement'); + // the sql text and request id should be the same as what was passed + // in + assert.strictEqual(statement.getSqlText(), sqlText); + assert.strictEqual(statement.getRequestId(), requestId); + callback(); } } }); - - // the sql text and request id should be the same as what was passed - // in - assert.strictEqual(statement.getSqlText(), sqlText); - assert.strictEqual(statement.getRequestId(), requestId); } ], function (err) { @@ -996,28 +988,29 @@ describe('connection.execute() with requestId', function () { }); it('sqlText is overwritten when resubmitting requests', function (done) { - let statement; - async.series( [ function (callback) { // request with only requestId specified - statement = connection.execute( + const statement = connection.execute( { // intentionally leave sqlText blank to invoke the connector to overwrite the sqlText - sqlText: '', + sqlText: blankSqlText, requestId: requestId, complete: function (err, stmt) { assert.ok(err, 'there should be an error'); assert.strictEqual(stmt, statement, 'the execute() callback should be invoked with the statement'); + // the sql text and request id should be the same as what was passed + // in + assert.strictEqual(stmt.getRequestId(), requestId); + // the sqlText on the statement is unchanged but the sqlText on the request is different + assert.strictEqual(stmt.getSqlText(), blankSqlText); + callback(); } }); - - // the request id should be the same as what was passed in - assert.strictEqual(statement.getRequestId(), requestId); } ], function (err) { From 4a45148f8a95b539d409594c1b672ba7437cb497 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Thu, 5 Oct 2023 08:10:34 -0700 Subject: [PATCH 11/11] SNOW-728803: Remove async series --- test/unit/snowflake_test.js | 88 +++++++++++++++---------------------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/test/unit/snowflake_test.js b/test/unit/snowflake_test.js index 603e38fc2..cebf544ed 100644 --- a/test/unit/snowflake_test.js +++ b/test/unit/snowflake_test.js @@ -953,68 +953,52 @@ describe('connection.execute() with requestId', function () { }); it('keep original sqlText when resubmitting requests', function (done) { - async.series( - [ - function (callback) { - // request with sqlText and requestId specified - const statement = connection.execute( - { - sqlText: sqlText, - requestId: requestId, - complete: function (err, stmt) { - // if there's an error, fail the test with the error - if (err) { - callback(err); - } - else { - assert.ok(!err, 'there should be no error'); - assert.strictEqual(stmt, statement, - 'the execute() callback should be invoked with the statement'); + // request with sqlText and requestId specified + const statement = connection.execute( + { + sqlText: sqlText, + requestId: requestId, + complete: function (err, stmt) { + // if there's an error, fail the test with the error + if (err) { + done(err); + } + else { + assert.ok(!err, 'there should be no error'); + assert.strictEqual(stmt, statement, + 'the execute() callback should be invoked with the statement'); - // the sql text and request id should be the same as what was passed - // in - assert.strictEqual(statement.getSqlText(), sqlText); - assert.strictEqual(statement.getRequestId(), requestId); + // the sql text and request id should be the same as what was passed + // in + assert.strictEqual(statement.getSqlText(), sqlText); + assert.strictEqual(statement.getRequestId(), requestId); - callback(); - } - } - }); + done(); + } } - ], - function (err) { - done(err); }); }); it('sqlText is overwritten when resubmitting requests', function (done) { - async.series( - [ - function (callback) { - // request with only requestId specified - const statement = connection.execute( - { - // intentionally leave sqlText blank to invoke the connector to overwrite the sqlText - sqlText: blankSqlText, - requestId: requestId, - complete: function (err, stmt) { - assert.ok(err, 'there should be an error'); - assert.strictEqual(stmt, statement, - 'the execute() callback should be invoked with the statement'); + // request with only requestId specified + const statement = connection.execute( + { + // intentionally leave sqlText blank to invoke the connector to overwrite the sqlText + sqlText: blankSqlText, + requestId: requestId, + complete: function (err, stmt) { + assert.ok(err, 'there should be an error'); + assert.strictEqual(stmt, statement, + 'the execute() callback should be invoked with the statement'); - // the sql text and request id should be the same as what was passed - // in - assert.strictEqual(stmt.getRequestId(), requestId); - // the sqlText on the statement is unchanged but the sqlText on the request is different - assert.strictEqual(stmt.getSqlText(), blankSqlText); + // the sql text and request id should be the same as what was passed + // in + assert.strictEqual(stmt.getRequestId(), requestId); + // the sqlText on the statement is unchanged but the sqlText on the request is different + assert.strictEqual(stmt.getSqlText(), blankSqlText); - callback(); - } - }); + done(); } - ], - function (err) { - done(err); }); }); });