From 4428678ebd56ee81294abfcd8a291469f727af53 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 30 Jun 2023 12:05:18 +0100 Subject: [PATCH] Quick fix for QA-core tests, when encrypt is undefined for MS-SQL, it defaults to true, need to be aware of this so can set trustServerCertificate correctly. Also fixing the naming of a test. --- packages/server/src/integrations/microsoftSqlServer.ts | 5 +++-- .../integrations/external-schema/mssql.integration.spec.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 2c1f069e8a..17cbf10e90 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -184,12 +184,13 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { async connect() { try { - const encrypt = this.config.encrypt + // if encrypt is undefined, then default is to encrypt + const encrypt = this.config.encrypt === undefined || this.config.encrypt const clientCfg: MSSQLConfig & sqlServer.config = { ...this.config, port: +this.config.port, options: { - encrypt: encrypt, + encrypt, enableArithAbort: true, }, } diff --git a/qa-core/src/integrations/external-schema/mssql.integration.spec.ts b/qa-core/src/integrations/external-schema/mssql.integration.spec.ts index 450b093cf7..a43edc4379 100644 --- a/qa-core/src/integrations/external-schema/mssql.integration.spec.ts +++ b/qa-core/src/integrations/external-schema/mssql.integration.spec.ts @@ -5,7 +5,7 @@ import mssql from "../../../../packages/server/src/integrations/microsoftSqlServ jest.unmock("mssql") describe("getExternalSchema", () => { - describe("postgres", () => { + describe("mssql", () => { let config: any beforeAll(async () => {