diff --git a/build/azure-pipelines/win32/sql-product-test-win32.yml b/build/azure-pipelines/win32/sql-product-test-win32.yml index f179d62e18..5f9042e0ba 100644 --- a/build/azure-pipelines/win32/sql-product-test-win32.yml +++ b/build/azure-pipelines/win32/sql-product-test-win32.yml @@ -38,7 +38,7 @@ steps: inputs: azureSubscription: 'ClientToolsInfra_670062 (88d5392f-a34f-4769-b405-f597fc533613)' KeyVaultName: SqlToolsSecretStore - SecretsFilter: 'ads-integration-test-azure-server,ads-integration-test-azure-server-password,ads-integration-test-azure-server-username,ads-integration-test-bdc-server,ads-integration-test-bdc-server-password,ads-integration-test-bdc-server-username,ads-integration-test-standalone-server,ads-integration-test-standalone-server-password,ads-integration-test-standalone-server-username' + SecretsFilter: 'ads-integration-test-azure-server,ads-integration-test-azure-server-password,ads-integration-test-azure-server-username,ads-integration-test-bdc-server,ads-integration-test-bdc-server-password,ads-integration-test-bdc-server-username,ads-integration-test-standalone-server,ads-integration-test-standalone-server-password,ads-integration-test-standalone-server-username,ads-integration-test-standalone-server-2019,ads-integration-test-standalone-server-password-2019,ads-integration-test-standalone-server-username-2019' - powershell: | . build/azure-pipelines/win32/exec.ps1 @@ -60,6 +60,9 @@ steps: AZURE_SQL_USERNAME: $(ads-integration-test-azure-server-username) AZURE_SQL_PWD: $(ads-integration-test-azure-server-password) AZURE_SQL: $(ads-integration-test-azure-server) + STANDALONE_SQL_USERNAME_2019: $(ads-integration-test-standalone-server-username-2019) + STANDALONE_SQL_PWD_2019: $(ads-integration-test-standalone-server-password-2019) + STANDALONE_SQL_2019: $(ads-integration-test-standalone-server-2019) - powershell: | . build/azure-pipelines/win32/exec.ps1 @@ -83,6 +86,9 @@ steps: AZURE_SQL_USERNAME: $(ads-integration-test-azure-server-username) AZURE_SQL_PWD: $(ads-integration-test-azure-server-password) AZURE_SQL: $(ads-integration-test-azure-server) + STANDALONE_SQL_USERNAME_2019: $(ads-integration-test-standalone-server-username-2019) + STANDALONE_SQL_PWD_2019: $(ads-integration-test-standalone-server-password-2019) + STANDALONE_SQL_2019: $(ads-integration-test-standalone-server-2019) - powershell: | . build/azure-pipelines/win32/exec.ps1 @@ -104,6 +110,9 @@ steps: AZURE_SQL_USERNAME: $(ads-integration-test-azure-server-username) AZURE_SQL_PWD: $(ads-integration-test-azure-server-password) AZURE_SQL: $(ads-integration-test-azure-server) + STANDALONE_SQL_USERNAME_2019: $(ads-integration-test-standalone-server-username-2019) + STANDALONE_SQL_PWD_2019: $(ads-integration-test-standalone-server-password-2019) + STANDALONE_SQL_2019: $(ads-integration-test-standalone-server-2019) - task: PublishTestResults@2 displayName: 'Publish Integration and Smoke Test Results' diff --git a/extensions/integration-tests/setEnvironmentVariables.js b/extensions/integration-tests/setEnvironmentVariables.js index b1a597aae5..9cd2228f53 100644 --- a/extensions/integration-tests/setEnvironmentVariables.js +++ b/extensions/integration-tests/setEnvironmentVariables.js @@ -96,6 +96,9 @@ const SECRET_BDC_SERVER_PASSWORD = 'ads-integration-test-bdc-server-password'; const SECRET_STANDALONE_SERVER = 'ads-integration-test-standalone-server'; const SECRET_STANDALONE_SERVER_USERNAME = 'ads-integration-test-standalone-server-username'; const SECRET_STANDALONE_SERVER_PASSWORD = 'ads-integration-test-standalone-server-password'; +const SECRET_STANDALONE_SERVER_2019 = 'ads-integration-test-standalone-server-2019'; +const SECRET_STANDALONE_SERVER_USERNAME_2019 = 'ads-integration-test-standalone-server-username-2019'; +const SECRET_STANDALONE_SERVER_PASSWORD_2019 = 'ads-integration-test-standalone-server-password-2019'; // Environment variable names const ENVAR_AZURE_SERVER = 'AZURE_SQL'; @@ -107,6 +110,9 @@ const ENVAR_BDC_SERVER_PASSWORD = 'BDC_BACKEND_PWD'; const ENVAR_STANDALONE_SERVER = 'STANDALONE_SQL'; const ENVAR_STANDALONE_SERVER_USERNAME = 'STANDALONE_SQL_USERNAME'; const ENVAR_STANDALONE_SERVER_PASSWORD = 'STANDALONE_SQL_PWD'; +const ENVAR_STANDALONE_SERVER_2019 = 'STANDALONE_SQL_2019'; +const ENVAR_STANDALONE_SERVER_USERNAME_2019 = 'STANDALONE_SQL_USERNAME_2019'; +const ENVAR_STANDALONE_SERVER_PASSWORD_2019 = 'STANDALONE_SQL_PWD_2019'; const ENVAR_PYTHON_INSTALL_PATH = 'PYTHON_TEST_PATH'; const ENVAR_RUN_PYTHON3_TEST = 'RUN_PYTHON3_TEST'; const ENVAR_RUN_PYSPARK_TEST = 'RUN_PYSPARK_TEST'; @@ -122,6 +128,9 @@ SecretEnVarMapping.push([SECRET_BDC_SERVER_USERNAME, ENVAR_BDC_SERVER_USERNAME]) SecretEnVarMapping.push([SECRET_STANDALONE_SERVER, ENVAR_STANDALONE_SERVER]); SecretEnVarMapping.push([SECRET_STANDALONE_SERVER_PASSWORD, ENVAR_STANDALONE_SERVER_PASSWORD]); SecretEnVarMapping.push([SECRET_STANDALONE_SERVER_USERNAME, ENVAR_STANDALONE_SERVER_USERNAME]); +SecretEnVarMapping.push([SECRET_STANDALONE_SERVER_2019, ENVAR_STANDALONE_SERVER_2019]); +SecretEnVarMapping.push([SECRET_STANDALONE_SERVER_USERNAME_2019, ENVAR_STANDALONE_SERVER_USERNAME_2019]); +SecretEnVarMapping.push([SECRET_STANDALONE_SERVER_PASSWORD_2019, ENVAR_STANDALONE_SERVER_PASSWORD_2019]); // Set the values that are not stored in AKV here process.env[ENVAR_PYTHON_INSTALL_PATH] = NOTEBOOK_PYTHON_INSTALL_PATH; @@ -131,7 +140,7 @@ process.env[ENVAR_RUN_PYSPARK_TEST] = '0'; const promises = []; // Open up a web browser to the login page so the user doesn't have to copy the URL manually -const start = (process.platform == 'darwin'? 'open': process.platform == 'win32'? 'start': 'xdg-open'); +const start = (process.platform == 'darwin' ? 'open' : process.platform == 'win32' ? 'start' : 'xdg-open'); child_process.exec(`${start} https://microsoft.com/devicelogin`); // Fetch the values from AKV @@ -164,4 +173,4 @@ msrestAzure.interactiveLogin().then((credentials) => { }, (err) => { console.error('An error occured while logging in to Azure portal'); console.error(err); -}); \ No newline at end of file +}); diff --git a/extensions/integration-tests/src/cms.test.ts b/extensions/integration-tests/src/cms.test.ts index c6bacff399..32ac6a8648 100644 --- a/extensions/integration-tests/src/cms.test.ts +++ b/extensions/integration-tests/src/cms.test.ts @@ -11,17 +11,17 @@ import * as utils from './utils'; import * as uuid from './uuid'; import { isTestSetupCompleted } from './testContext'; import assert = require('assert'); -import { getStandaloneServer, TestServerProfile, getBdcServer } from './testConfig'; +import { getStandaloneServer, TestServerProfile } from './testConfig'; let cmsService: mssql.ICmsService; let server: TestServerProfile; let connectionId: string; let ownerUri: string; const SERVER_CONNECTION_TIMEOUT: number = 3000; -const TEST_CMS_NAME = `adsTestCms_${uuid.v4()}`; -const TEST_CMS_GROUP = `adsTestCmsGroup_${uuid.v4()}`; -const TEST_CMS_SERVER = `adsTestCmsServer_${uuid.v4()}`; -const TEST_CMS_REG_SERVER = `adsTestCmsRegisteredServer_${uuid.v4()}`; +const TEST_CMS_NAME = `adsTestCms_${uuid.v4().asHex()}`; +const TEST_CMS_GROUP = `adsTestCmsGroup_${uuid.v4().asHex()}`; +const TEST_CMS_SERVER = `adsTestCmsServer_${uuid.v4().asHex()}`; +const TEST_CMS_REG_SERVER = `adsTestCmsRegisteredServer_${uuid.v4().asHex()}`; if (isTestSetupCompleted()) { suite('CMS integration test suite', () => { @@ -101,26 +101,26 @@ if (isTestSetupCompleted()) { async () => cmsService.addRegisteredServer(ownerUri, '', undefined, 'test_description', undefined), 'Cannot add a registered without a name or connection'); - let bdcServer = await getBdcServer(); - let bdcConnection = { - serverName: bdcServer.serverName, - userName: bdcServer.userName, - password: bdcServer.password, - authenticationType: bdcServer.authenticationTypeName, - database: bdcServer.database, - provider: bdcServer.provider, - version: bdcServer.version, - engineType: bdcServer.engineType, + let server = await getStandaloneServer('2019'); + let connection = { + serverName: server.serverName, + userName: server.userName, + password: server.password, + authenticationType: server.authenticationTypeName, + database: server.database, + provider: server.provider, + version: server.version, + engineType: server.engineType, options: {} }; // Should create a registered server - let result = await cmsService.addRegisteredServer(ownerUri, '', TEST_CMS_SERVER, 'test_description', bdcConnection); + let result = await cmsService.addRegisteredServer(ownerUri, '', TEST_CMS_SERVER, 'test_description', connection); assert(result === true, `Registered server ${TEST_CMS_SERVER} was not added to CMS server successfully`); // Shouldn't be able to create a new registered server with same name await utils.assertThrowsAsync( - async () => await cmsService.addRegisteredServer(ownerUri, '', TEST_CMS_SERVER, 'test_description', bdcConnection), + async () => await cmsService.addRegisteredServer(ownerUri, '', TEST_CMS_SERVER, 'test_description', connection), 'Cannot add a registered server with existing name'); // Should remove the registered server we added above @@ -140,21 +140,21 @@ if (isTestSetupCompleted()) { `Registered Server Group ${TEST_CMS_GROUP} was not found after being added. Groups : [${cmsResources.registeredServerGroups.map(g => g.name).join(', ')}]`); // Should create a registered server under the group - let bdcServer = await getBdcServer(); - let bdcConnection = { - serverName: bdcServer.serverName, - userName: bdcServer.userName, - password: bdcServer.password, - authenticationType: bdcServer.authenticationTypeName, - database: bdcServer.database, - provider: bdcServer.provider, - version: bdcServer.version, - engineType: bdcServer.engineType, + let server = await getStandaloneServer('2019'); + let connection = { + serverName: server.serverName, + userName: server.userName, + password: server.password, + authenticationType: server.authenticationTypeName, + database: server.database, + provider: server.provider, + version: server.version, + engineType: server.engineType, options: {} }; let relativePath = cmsResources.registeredServerGroups[0].relativePath; - result = await cmsService.addRegisteredServer(ownerUri, relativePath, TEST_CMS_REG_SERVER, 'test_description', bdcConnection); + result = await cmsService.addRegisteredServer(ownerUri, relativePath, TEST_CMS_REG_SERVER, 'test_description', connection); assert(result === true, `Registered server ${TEST_CMS_REG_SERVER} was not added to server group successfully`); // Should remove the server group we added above diff --git a/extensions/integration-tests/src/notebook.test.ts b/extensions/integration-tests/src/notebook.test.ts index 47be290d8f..664a4aa29f 100644 --- a/extensions/integration-tests/src/notebook.test.ts +++ b/extensions/integration-tests/src/notebook.test.ts @@ -9,7 +9,7 @@ import * as azdata from 'azdata'; import * as vscode from 'vscode'; import { isTestSetupCompleted } from './testContext'; import { sqlNotebookContent, writeNotebookToFile, sqlKernelMetadata, getFileName, pySparkNotebookContent, pySparkKernelMetadata, pythonKernelMetadata, sqlNotebookMultipleCellsContent, notebookContentForCellLanguageTest, sqlKernelSpec, pythonKernelSpec, pySparkKernelSpec, CellTypes } from './notebook.util'; -import { getBdcServer, getConfigValue, EnvironmentVariable_PYTHON_PATH, TestServerProfile } from './testConfig'; +import { getConfigValue, EnvironmentVariable_PYTHON_PATH, TestServerProfile, getStandaloneServer } from './testConfig'; import { connectToServer, sleep, testServerProfileToIConnectionProfile } from './utils'; import * as fs from 'fs'; import { stressify } from 'adstest'; @@ -19,7 +19,7 @@ if (isTestSetupCompleted()) { suite('Notebook integration test suite', function () { setup(async function () { console.log(`Start "${this.currentTest.title}"`); - let server = await getBdcServer(); + let server = await getStandaloneServer(); assert(server && server.serverName, 'No server could be found'); await connectToServer(server, 6000); }); @@ -394,7 +394,7 @@ class NotebookTester { notebookConfig.update('pythonPath', getConfigValue(EnvironmentVariable_PYTHON_PATH), 1); let server: TestServerProfile; if (!connectToDifferentServer) { - server = await getBdcServer(); + server = await getStandaloneServer(); assert(server && server.serverName, 'No server could be found in openNotebook'); await connectToServer(server, 6000); } diff --git a/extensions/integration-tests/src/objectExplorer.test.ts b/extensions/integration-tests/src/objectExplorer.test.ts index 61bd1b2811..bca530dd65 100644 --- a/extensions/integration-tests/src/objectExplorer.test.ts +++ b/extensions/integration-tests/src/objectExplorer.test.ts @@ -13,7 +13,7 @@ import { stressify } from 'adstest'; if (isTestSetupCompleted()) { suite('Object Explorer integration suite', () => { - test('BDC instance node label test', async function () { + test.skip('BDC instance node label test', async function () { return await (new ObjectExplorerTester()).bdcNodeLabelTest(); }); test('Standalone instance node label test', async function () { @@ -22,7 +22,7 @@ if (isTestSetupCompleted()) { test('Azure SQL DB instance node label test @UNSTABLE@', async function () { return await (new ObjectExplorerTester()).sqlDbNodeLabelTest(); }); - test('BDC instance context menu test', async function () { + test.skip('BDC instance context menu test', async function () { return await (new ObjectExplorerTester()).bdcContextMenuTest(); }); test('Azure SQL DB context menu test @UNSTABLE@', async function () { diff --git a/extensions/integration-tests/src/testConfig.ts b/extensions/integration-tests/src/testConfig.ts index 4f495ee857..a13705a967 100644 --- a/extensions/integration-tests/src/testConfig.ts +++ b/extensions/integration-tests/src/testConfig.ts @@ -63,6 +63,9 @@ export const EnvironmentVariable_AZURE_SERVER: string = 'AZURE_SQL'; export const EnvironmentVariable_AZURE_USERNAME: string = 'AZURE_SQL_USERNAME'; export const EnvironmentVariable_AZURE_PASSWORD: string = 'AZURE_SQL_PWD'; export const EnvironmentVariable_PYTHON_PATH: string = 'PYTHON_TEST_PATH'; +export const EnvironmentVariable_STANDALONE_SERVER_2019: string = 'STANDALONE_SQL_2019'; +export const EnvironmentVariable_STANDALONE_USERNAME_2019: string = 'STANDALONE_SQL_USERNAME_2019'; +export const EnvironmentVariable_STANDALONE_PASSWORD_2019: string = 'STANDALONE_SQL_PWD_2019'; export class TestServerProfile { constructor(private _profile: ITestServerProfile) { } @@ -113,6 +116,17 @@ let TestingServers: TestServerProfile[] = [ provider: ConnectionProvider.SQLServer, version: '2019', engineType: EngineType.BigDataCluster + }), + new TestServerProfile( + { + serverName: getConfigValue(EnvironmentVariable_STANDALONE_SERVER_2019), + userName: getConfigValue(EnvironmentVariable_STANDALONE_USERNAME_2019), + password: getConfigValue(EnvironmentVariable_STANDALONE_PASSWORD_2019), + authenticationType: AuthenticationType.SqlLogin, + database: 'master', + provider: ConnectionProvider.SQLServer, + version: '2019', + engineType: EngineType.Standalone }) ]; @@ -130,9 +144,9 @@ export async function getAzureServer(): Promise { return servers.filter(s => s.engineType === EngineType.Azure)[0]; } -export async function getStandaloneServer(): Promise { +export async function getStandaloneServer(version: '2017' | '2019' = '2017'): Promise { let servers = await getTestingServers(); - return servers.filter(s => s.version === '2017' && s.engineType === EngineType.Standalone)[0]; + return servers.filter(s => s.version === version && s.engineType === EngineType.Standalone)[0]; } export async function getBdcServer(): Promise { diff --git a/extensions/integration-tests/src/utils.ts b/extensions/integration-tests/src/utils.ts index d160f4b817..79d5345abf 100644 --- a/extensions/integration-tests/src/utils.ts +++ b/extensions/integration-tests/src/utils.ts @@ -105,7 +105,7 @@ export async function createDB(dbName: string, ownerUri: string): Promise SELECT ERROR_MESSAGE() AS ErrorMessage; END CATCH`; - let dbCreatedResult = await this.runQuery(query, ownerUri); + let dbCreatedResult = await runQuery(query, ownerUri); assert(dbCreatedResult.columnInfo[0].columnName !== 'ErrorMessage', 'DB creation threw error'); } @@ -122,7 +122,7 @@ export async function deleteDB(server: TestServerProfile, dbName: string, ownerU END CATCH`; ownerUri = await ensureServerConnected(server, ownerUri); - let dbDeleteResult = await this.runQuery(query, ownerUri); + let dbDeleteResult = await runQuery(query, ownerUri); assert(dbDeleteResult.columnInfo[0].columnName !== 'ErrorMessage', 'DB deletion threw error'); }