From c410a7bb07e4b052bbcee842c20b983d336f599d Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Fri, 13 Sep 2024 15:55:33 +0200 Subject: [PATCH] clickhouse tests --- .../__tests__/object-analyse.spec.js | 28 +++++++++---------- integration-tests/engines.js | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/integration-tests/__tests__/object-analyse.spec.js b/integration-tests/__tests__/object-analyse.spec.js index b088d1b6..e49e098d 100644 --- a/integration-tests/__tests__/object-analyse.spec.js +++ b/integration-tests/__tests__/object-analyse.spec.js @@ -2,7 +2,7 @@ const { testWrapper } = require('../tools'); const engines = require('../engines'); const _ = require('lodash'); -const initSql = ['CREATE TABLE t1 (id int)', 'CREATE TABLE t2 (id int)']; +const initSql = ['CREATE TABLE t1 (id int primary key)', 'CREATE TABLE t2 (id int primary key)']; function flatSource() { return _.flatten( @@ -26,9 +26,9 @@ describe('Object analyse', () => { test.each(flatSource())( 'Full analysis - %s - %s', testWrapper(async (conn, driver, type, object, engine) => { - for (const sql of initSql) await driver.query(conn, sql); + for (const sql of initSql) await driver.query(conn, sql, { discardResult: true }); - await driver.query(conn, object.create1); + await driver.query(conn, object.create1, { discardResult: true }); const structure = await driver.analyseFull(conn); expect(structure[type].length).toEqual(1); @@ -39,11 +39,11 @@ describe('Object analyse', () => { test.each(flatSource())( 'Incremental analysis - add - %s - %s', testWrapper(async (conn, driver, type, object, engine) => { - for (const sql of initSql) await driver.query(conn, sql); + for (const sql of initSql) await driver.query(conn, sql, { discardResult: true }); - await driver.query(conn, object.create2); + await driver.query(conn, object.create2, { discardResult: true }); const structure1 = await driver.analyseFull(conn); - await driver.query(conn, object.create1); + await driver.query(conn, object.create1, { discardResult: true }); const structure2 = await driver.analyseIncremental(conn, structure1); expect(structure2[type].length).toEqual(2); @@ -54,12 +54,12 @@ describe('Object analyse', () => { test.each(flatSource())( 'Incremental analysis - drop - %s - %s', testWrapper(async (conn, driver, type, object, engine) => { - for (const sql of initSql) await driver.query(conn, sql); + for (const sql of initSql) await driver.query(conn, sql, { discardResult: true }); - await driver.query(conn, object.create1); - await driver.query(conn, object.create2); + await driver.query(conn, object.create1, { discardResult: true }); + await driver.query(conn, object.create2, { discardResult: true }); const structure1 = await driver.analyseFull(conn); - await driver.query(conn, object.drop2); + await driver.query(conn, object.drop2, { discardResult: true }); const structure2 = await driver.analyseIncremental(conn, structure1); expect(structure2[type].length).toEqual(1); @@ -70,15 +70,15 @@ describe('Object analyse', () => { test.each(flatSource())( 'Create SQL - add - %s - %s', testWrapper(async (conn, driver, type, object, engine) => { - for (const sql of initSql) await driver.query(conn, sql); + for (const sql of initSql) await driver.query(conn, sql, { discardResult: true }); - await driver.query(conn, object.create1); + await driver.query(conn, object.create1, { discardResult: true }); const structure1 = await driver.analyseFull(conn); - await driver.query(conn, object.drop1); + await driver.query(conn, object.drop1, { discardResult: true }); const structure2 = await driver.analyseIncremental(conn, structure1); expect(structure2[type].length).toEqual(0); - await driver.query(conn, structure1[type][0].createSql); + await driver.query(conn, structure1[type][0].createSql, { discardResult: true }); const structure3 = await driver.analyseIncremental(conn, structure2); diff --git a/integration-tests/engines.js b/integration-tests/engines.js index 2186c339..1312c5c6 100644 --- a/integration-tests/engines.js +++ b/integration-tests/engines.js @@ -154,7 +154,7 @@ const engines = [ const filterLocal = [ // filter local testing - 'MySQL', + '-MySQL', '-MariaDB', '-PostgreSQL', '-SQL Server',