Remove all Big Data Cluster features (#21369)

This commit is contained in:
Cory Rivera
2022-12-07 12:28:17 -08:00
committed by GitHub
parent bb1f5bfffe
commit e2327c393a
213 changed files with 346 additions and 46800 deletions

View File

@@ -8,7 +8,7 @@ import * as assert from 'assert';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as path from 'path';
import { sqlNotebookContent, writeNotebookToFile, sqlKernelMetadata, getTempFilePath, pySparkNotebookContent, pySparkKernelMetadata, pythonKernelMetadata, sqlNotebookMultipleCellsContent, notebookContentForCellLanguageTest, sqlKernelSpec, pythonKernelSpec, pySparkKernelSpec, CellTypes } from './notebook.util';
import { sqlNotebookContent, writeNotebookToFile, sqlKernelMetadata, getTempFilePath, pythonKernelMetadata, sqlNotebookMultipleCellsContent, notebookContentForCellLanguageTest, sqlKernelSpec, pythonKernelSpec, CellTypes, pythonNotebookContent, powershellKernelSpec } from './notebook.util';
import { getConfigValue, EnvironmentVariable_PYTHON_PATH, TestServerProfile, getStandaloneServer } from './testConfig';
import { connectToServer, sleep, testServerProfileToIConnectionProfile } from './utils';
import * as fs from 'fs';
@@ -149,7 +149,7 @@ suite('Notebook integration test suite', function () {
if (process.env['RUN_PYTHON3_TEST'] === '1') {
test('Python3 notebook test', async function () {
let notebook = await openNotebook(pySparkNotebookContent, pythonKernelMetadata, this.test.title);
let notebook = await openNotebook(pythonNotebookContent, pythonKernelMetadata, this.test.title);
await runCell(notebook);
let cellOutputs = notebook.document.cells[0].contents.outputs;
console.log('Got cell outputs ---');
@@ -161,7 +161,7 @@ suite('Notebook integration test suite', function () {
});
test('Clear all outputs - Python3 notebook ', async function () {
let notebook = await openNotebook(pySparkNotebookContent, pythonKernelMetadata, this.test.title);
let notebook = await openNotebook(pythonNotebookContent, pythonKernelMetadata, this.test.title);
await runCell(notebook);
await verifyClearAllOutputs(notebook);
});
@@ -197,7 +197,7 @@ suite('Notebook integration test suite', function () {
});
test('Change kernel different provider Python to SQL to Python', async function () {
let notebook = await openNotebook(pySparkNotebookContent, pythonKernelMetadata, this.test.title);
let notebook = await openNotebook(pythonNotebookContent, pythonKernelMetadata, this.test.title);
await runCell(notebook);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(notebook.document.kernelSpec.name === 'python3', `Expected first kernel name: python3, Actual: ${notebook.document.kernelSpec.name}`);
@@ -211,48 +211,23 @@ suite('Notebook integration test suite', function () {
assert(kernelChanged && notebook.document.kernelSpec.name === 'python3', `Expected third kernel name: python3, Actual: ${notebook.document.kernelSpec.name}`);
});
test('Change kernel same provider Python to PySpark to Python', async function () {
let notebook = await openNotebook(pySparkNotebookContent, pythonKernelMetadata, this.test.title);
await runCell(notebook);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(notebook.document.kernelSpec.name === 'python3', `Expected first kernel name: python3, Actual: ${notebook.document.kernelSpec.name}`);
let kernelChanged = await notebook.changeKernel(pySparkKernelSpec);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(kernelChanged && notebook.document.kernelSpec.name === 'pysparkkernel', `Expected second kernel name: pysparkkernel, Actual: ${notebook.document.kernelSpec.name}`);
kernelChanged = await notebook.changeKernel(pythonKernelSpec);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(kernelChanged && notebook.document.kernelSpec.name === 'python3', `Expected third kernel name: python3, Actual: ${notebook.document.kernelSpec.name}`);
});
}
if (process.env['RUN_PYSPARK_TEST'] === '1') {
test('PySpark notebook test', async function () {
let notebook = await openNotebook(pySparkNotebookContent, pySparkKernelMetadata, this.test.title);
test('Change kernel same provider Python to Powershell to Python', async function () {
let notebook = await openNotebook(pythonNotebookContent, pythonKernelMetadata, this.test.title);
await runCell(notebook);
let cellOutputs = notebook.document.cells[0].contents.outputs;
let sparkResult = (<azdata.nb.IStreamResult>cellOutputs[3]).text;
assert(sparkResult === '2', `Expected spark result: 2, Actual: ${sparkResult}`);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(notebook.document.kernelSpec.name === 'python3', `Expected first kernel name: python3, Actual: ${notebook.document.kernelSpec.name}`);
let kernelChanged = await notebook.changeKernel(powershellKernelSpec);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(kernelChanged && notebook.document.kernelSpec.name === 'powershell', `Expected second kernel name: powershell, Actual: ${notebook.document.kernelSpec.name}`);
kernelChanged = await notebook.changeKernel(pythonKernelSpec);
assert(notebook.document.providerId === 'jupyter', `Expected providerId to be jupyter, Actual: ${notebook.document.providerId}`);
assert(kernelChanged && notebook.document.kernelSpec.name === 'python3', `Expected third kernel name: python3, Actual: ${notebook.document.kernelSpec.name}`);
});
}
/* After https://github.com/microsoft/azuredatastudio/issues/5598 is fixed, enable these tests.
test('scala language test', async function () {
let language = 'scala';
await cellLanguageTest(notebookContentForCellLanguageTest, this.test.title, language, {
'kernelspec': {
'name': '',
'display_name': ''
},
'language_info': {
name: language,
version: '',
mimetype: ''
}
});
});
test('empty language test', async function () {
let language = '';
await cellLanguageTest(notebookContentForCellLanguageTest, this.test.title, language, {

View File

@@ -19,7 +19,7 @@ export class CellTypes {
public static readonly Raw = 'raw';
}
export const pySparkNotebookContent: azdata.nb.INotebookContents = {
export const pythonNotebookContent: azdata.nb.INotebookContents = {
cells: [{
cell_type: CellTypes.Code,
source: '1+1',
@@ -28,8 +28,8 @@ export const pySparkNotebookContent: azdata.nb.INotebookContents = {
}],
metadata: {
kernelspec: {
name: 'pysparkkernel',
display_name: 'PySpark'
name: 'python3',
display_name: 'Python 3'
}
},
nbformat: NBFORMAT,
@@ -129,18 +129,6 @@ export const sqlNotebookMultipleCellsContent: azdata.nb.INotebookContents = {
nbformat_minor: NBFORMAT_MINOR
};
export const pySparkKernelMetadata = {
kernelspec: {
name: 'pysparkkernel',
display_name: 'PySpark'
}
};
export const pySparkKernelSpec = {
name: 'pyspark',
display_name: 'PySpark'
};
export const sqlKernelMetadata = {
kernelspec: {
name: 'SQL',
@@ -165,6 +153,11 @@ export const pythonKernelSpec: azdata.nb.IKernelSpec = {
display_name: 'Python 3'
};
export const powershellKernelSpec: azdata.nb.IKernelSpec = {
name: 'powershell',
display_name: 'PowerShell'
};
export function writeNotebookToFile(pythonNotebook: azdata.nb.INotebookContents, relativeFilePath: string): vscode.Uri {
let fileName = getTempFilePath(relativeFilePath);
let notebookContentString = JSON.stringify(pythonNotebook);

View File

@@ -5,16 +5,11 @@
import 'mocha';
import * as azdata from 'azdata';
import { getBdcServer, TestServerProfile, getAzureServer, getStandaloneServer } from './testConfig';
import { TestServerProfile, getAzureServer, getStandaloneServer } from './testConfig';
import { connectToServer, createDB, DefaultConnectTimeoutInMs, asyncTimeout, tryDeleteDB } from './utils';
import * as assert from 'assert';
suite('Object Explorer integration suite', () => {
test.skip('BDC instance node label test', async function () {
const expectedNodeLabel = ['Databases', 'Security', 'Server Objects'];
const server = await getBdcServer();
await verifyOeNode(server, DefaultConnectTimeoutInMs, expectedNodeLabel);
});
test('Standalone instance node label test', async function () {
if (process.platform === 'win32') {
const expectedNodeLabel = ['Databases', 'Security', 'Server Objects'];
@@ -27,18 +22,6 @@ suite('Object Explorer integration suite', () => {
const server = await getAzureServer();
await verifyOeNode(server, DefaultConnectTimeoutInMs, expectedNodeLabel);
});
test.skip('BDC instance context menu test', async function () {
const server = await getBdcServer();
let expectedActions: string[];
// Properties comes from the admin-tool-ext-win extension which is for Windows only, so the item won't show up on non-Win32 platforms
if (process.platform === 'win32') {
expectedActions = ['Manage', 'New Query', 'New Notebook', 'Disconnect', 'Delete Connection', 'Refresh', 'Data-tier Application wizard', 'Launch Profiler', 'Properties'];
}
else {
expectedActions = ['Manage', 'New Query', 'New Notebook', 'Disconnect', 'Delete Connection', 'Refresh', 'Data-tier Application wizard', 'Launch Profiler'];
}
return await verifyContextMenu(server, expectedActions);
});
test('Azure SQL DB context menu test @UNSTABLE@', async function () {
const server = await getAzureServer();
const expectedActions = ['Manage', 'New Query', 'New Notebook', 'Disconnect', 'Delete Connection', 'Refresh', 'Data-tier Application wizard', 'Launch Profiler'];

View File

@@ -40,7 +40,6 @@ export enum ConnectionProvider {
export enum EngineType {
Standalone,
Azure,
BigDataCluster
}
let connectionProviderMapping: { [key: string]: { name: string; displayName: string } } = {};
@@ -55,9 +54,6 @@ export function getConfigValue(name: string): string {
return configValue ? configValue.toString() : '';
}
export const EnvironmentVariable_BDC_SERVER: string = 'BDC_BACKEND_HOSTNAME';
export const EnvironmentVariable_BDC_USERNAME: string = 'BDC_BACKEND_USERNAME';
export const EnvironmentVariable_BDC_PASSWORD: string = 'BDC_BACKEND_PWD';
export const EnvironmentVariable_STANDALONE_SERVER: string = 'STANDALONE_SQL';
export const EnvironmentVariable_STANDALONE_USERNAME: string = 'STANDALONE_SQL_USERNAME';
export const EnvironmentVariable_STANDALONE_PASSWORD: string = 'STANDALONE_SQL_PWD';
@@ -116,17 +112,6 @@ let TestingServers: TestServerProfile[] = [
version: '2012',
engineType: EngineType.Azure
}),
new TestServerProfile(
{
serverName: getConfigValue(EnvironmentVariable_BDC_SERVER),
userName: getConfigValue(EnvironmentVariable_BDC_USERNAME),
password: getConfigValue(EnvironmentVariable_BDC_PASSWORD),
authenticationType: AuthenticationType.SqlLogin,
database: 'master',
provider: ConnectionProvider.SQLServer,
version: '2019',
engineType: EngineType.BigDataCluster
}),
new TestServerProfile(
{
serverName: getConfigValue(EnvironmentVariable_STANDALONE_SERVER_2019),
@@ -159,11 +144,6 @@ export async function getStandaloneServer(version: '2017' | '2019' = '2017'): Pr
return servers.filter(s => s.version === version && s.engineType === EngineType.Standalone)[0];
}
export async function getBdcServer(): Promise<TestServerProfile> {
let servers = await getTestingServers();
return servers.filter(s => s.version === '2019' && s.engineType === EngineType.BigDataCluster)[0];
}
export async function getTestingServers(): Promise<TestServerProfile[]> {
let promise = new Promise<TestServerProfile[]>(resolve => {
resolve(TestingServers);