Skip to content

Commit

Permalink
Removed creating DB for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Sep 21, 2023
1 parent de7fb4f commit e28fea0
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions test/integration/testHTAP.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,49 @@ const { configureLogger } = require('../configureLogger');


describe('Query Context Cache test', function () {
const tableName = ['t1','t2','t3']
this.timeout(1000000);
let connection;
before(() => {
connection = testUtil.createConnection(connOption);
configureLogger('TRACE');
});

after(async () =>
{
testUtil.destroyConnectionAsync(connection);
after(async () => {
configureLogger('ERROR');

await testUtil.dropTablesIgnoringErrorsAsync(connection, tableName);
await testUtil.destroyConnectionAsync(connection);
});
const querySet = [
{
sqlTexts:[
'create or replace database db1',
// 'create or replace database db1',
'create or replace hybrid table t1 (a int primary key, b int)',
'insert into t1 values (1, 2), (2, 3), (3, 4)'
],
QccSize:2,
},
{
sqlTexts:[
// 'create or replace database db2',
'create or replace hybrid table t2 (a int primary key, b int)',
'insert into t2 values (1, 2), (2, 3), (3, 4)'
],
QccSize:2,
},
{
sqlTexts:[
// 'create or replace database db3',
'create or replace hybrid table t3 (a int primary key, b int)',
'insert into t3 values (1, 2), (2, 3), (3, 4)'
],
QccSize:2,
},
// {
// sqlTexts:[
// 'create or replace database db2',
// 'create or replace hybrid table t2 (a int primary key, b int)',
// 'insert into t2 values (1, 2), (2, 3), (3, 4)'
// ],
// QccSize:3,
// },
// {
// sqlTexts:[
// 'create or replace database db3',
// 'create or replace hybrid table t3 (a int primary key, b int)',
// 'insert into t3 values (1, 2), (2, 3), (3, 4)'
// ],
// QccSize:4,
// },
// {
// sqlTexts:[
// 'select * from db1.public.t1 x, db2.public.t2 y, db3.public.t3 z where x.a = y.a and y.a = z.a;',
// 'select * from db1.public.t1 x, db2.public.t2 y where x.a = y.a;',
// 'select * from db2.public.t2 y, db3.public.t3 z where y.a = z.a;'
// 'select * from public.t1 x, public.t2 y, public.t3 z where x.a = y.a and y.a = z.a;',
// 'select * from public.t1 x, public.t2 y where x.a = y.a;',
// 'select * from public.t2 y, public.t3 z where y.a = z.a;'
// ],
// QccSize:4,
// },
Expand All @@ -64,7 +64,8 @@ describe('Query Context Cache test', function () {
testingfunction = function(callback) {
connection.execute({
sqlText: sqlTexts[k],
complete: function () {
complete: function (err) {
assert.ok(!err,'There should be no error!');
callback();
}
});
Expand All @@ -73,7 +74,7 @@ describe('Query Context Cache test', function () {
else{
testingfunction = function(callback) {
connection.execute({
sqlText: sqlTexts[2],
sqlText: sqlTexts[k],
complete: function (err, stmt) {
assert.ok(!err,'There should be no error!');
assert.strictEqual(stmt.getQueryContextCacheSize(), QccSize);
Expand Down

0 comments on commit e28fea0

Please sign in to comment.