mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Remove all Big Data Cluster features (#21369)
This commit is contained in:
@@ -203,39 +203,4 @@ describe('notebookUtils Tests', function (): void {
|
||||
should(notebookEditor.document.cells[0].contents.cell_type).equal(CellTypes.Markdown);
|
||||
});
|
||||
});
|
||||
|
||||
describe('analyzeNotebook', function () {
|
||||
it('creates cell when oeContext exists', async function (): Promise<void> {
|
||||
await azdata.nb.showNotebookDocument(vscode.Uri.from({ scheme: 'untitled' }));
|
||||
const notebookEditor = azdata.nb.activeNotebookEditor;
|
||||
sinon.replaceGetter(azdata.nb, 'activeNotebookEditor', () => notebookEditor);
|
||||
sinon.stub(azdata.nb, 'showNotebookDocument').returns(Promise.resolve(notebookEditor));
|
||||
const oeContext: azdata.ObjectExplorerContext = {
|
||||
connectionProfile: undefined,
|
||||
isConnectionNode: true,
|
||||
nodeInfo: {
|
||||
nodePath: 'path/HDFS/path2',
|
||||
errorMessage: undefined,
|
||||
isLeaf: false,
|
||||
label: 'fakeLabel',
|
||||
metadata: undefined,
|
||||
nodeStatus: undefined,
|
||||
nodeSubType: undefined,
|
||||
nodeType: undefined
|
||||
}
|
||||
};
|
||||
await notebookUtils.analyzeNotebook(oeContext);
|
||||
should(notebookEditor.document.cells.length).equal(1, 'One cell should exist');
|
||||
should(notebookEditor.document.cells[0].contents.cell_type).equal(CellTypes.Code, 'Cell was created with incorrect type');
|
||||
});
|
||||
|
||||
it('does not create new cell when oeContext does not exist', async function (): Promise<void> {
|
||||
await azdata.nb.showNotebookDocument(vscode.Uri.from({ scheme: 'untitled' }));
|
||||
const notebookEditor = azdata.nb.activeNotebookEditor;
|
||||
sinon.replaceGetter(azdata.nb, 'activeNotebookEditor', () => notebookEditor);
|
||||
sinon.stub(azdata.nb, 'showNotebookDocument').returns(Promise.resolve(notebookEditor));
|
||||
await notebookUtils.analyzeNotebook();
|
||||
should(notebookEditor.document.cells.length).equal(0, 'No cells should exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,23 +10,9 @@ import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as utils from '../../common/utils';
|
||||
import { MockOutputChannel } from './stubs';
|
||||
import * as azdata from 'azdata';
|
||||
import { sleep } from './testUtils';
|
||||
|
||||
describe('Utils Tests', function () {
|
||||
|
||||
it('getKnoxUrl', () => {
|
||||
const host = '127.0.0.1';
|
||||
const port = '8080';
|
||||
should(utils.getKnoxUrl(host, port)).endWith('/gateway');
|
||||
});
|
||||
|
||||
it('getLivyUrl', () => {
|
||||
const host = '127.0.0.1';
|
||||
const port = '8080';
|
||||
should(utils.getLivyUrl(host, port)).endWith('/gateway/default/livy/v1/');
|
||||
});
|
||||
|
||||
it('ensureDir', async () => {
|
||||
const dirPath = path.join(os.tmpdir(), uuid.v4());
|
||||
await should(fs.stat(dirPath)).be.rejected();
|
||||
@@ -273,63 +259,6 @@ describe('Utils Tests', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getClusterEndpoints', () => {
|
||||
const baseServerInfo: azdata.ServerInfo = {
|
||||
serverMajorVersion: -1,
|
||||
serverMinorVersion: -1,
|
||||
serverReleaseVersion: -1,
|
||||
engineEditionId: -1,
|
||||
serverVersion: '',
|
||||
serverLevel: '',
|
||||
serverEdition: '',
|
||||
isCloud: false,
|
||||
azureVersion: -1,
|
||||
osVersion: '',
|
||||
options: {},
|
||||
cpuCount: -1,
|
||||
physicalMemoryInMb: -1
|
||||
};
|
||||
it('empty endpoints does not error', () => {
|
||||
const serverInfo = Object.assign({}, baseServerInfo);
|
||||
serverInfo.options['clusterEndpoints'] = [];
|
||||
should(utils.getClusterEndpoints(serverInfo).length).equal(0);
|
||||
});
|
||||
|
||||
it('endpoints without endpoint field are created successfully', () => {
|
||||
const serverInfo = Object.assign({}, baseServerInfo);
|
||||
const ipAddress = 'localhost';
|
||||
const port = '123';
|
||||
serverInfo.options['clusterEndpoints'] = [{ ipAddress: ipAddress, port: port }];
|
||||
const endpoints = utils.getClusterEndpoints(serverInfo);
|
||||
should(endpoints.length).equal(1);
|
||||
should(endpoints[0].endpoint).equal('https://localhost:123');
|
||||
});
|
||||
|
||||
it('endpoints with endpoint field are created successfully', () => {
|
||||
const endpoint = 'https://myActualEndpoint:8080';
|
||||
const serverInfo = Object.assign({}, baseServerInfo);
|
||||
serverInfo.options['clusterEndpoints'] = [{ endpoint: endpoint, ipAddress: 'localhost', port: '123' }];
|
||||
const endpoints = utils.getClusterEndpoints(serverInfo);
|
||||
should(endpoints.length).equal(1);
|
||||
should(endpoints[0].endpoint).equal(endpoint);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getHostAndPortFromEndpoint', () => {
|
||||
it('valid endpoint is parsed correctly', () => {
|
||||
const host = 'localhost';
|
||||
const port = '123';
|
||||
const hostAndIp = utils.getHostAndPortFromEndpoint(`https://${host}:${port}`);
|
||||
should(hostAndIp).deepEqual({ host: host, port: port });
|
||||
});
|
||||
|
||||
it('invalid endpoint is returned as is', () => {
|
||||
const host = 'localhost';
|
||||
const hostAndIp = utils.getHostAndPortFromEndpoint(`https://${host}`);
|
||||
should(hostAndIp).deepEqual({ host: host, port: undefined });
|
||||
});
|
||||
});
|
||||
|
||||
describe('exists', () => {
|
||||
it('runs as expected', async () => {
|
||||
const filename = path.join(os.tmpdir(), `NotebookUtilsTest_${uuid.v4()}`);
|
||||
@@ -345,12 +274,6 @@ describe('Utils Tests', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getIgnoreSslVerificationConfigSetting', () => {
|
||||
it('runs as expected', async () => {
|
||||
should(utils.getIgnoreSslVerificationConfigSetting()).be.true();
|
||||
});
|
||||
});
|
||||
|
||||
describe('debounce', () => {
|
||||
class DebounceTest {
|
||||
public fnCalled = 0;
|
||||
|
||||
Reference in New Issue
Block a user