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

@@ -1,57 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as TypeMoq from 'typemoq';
import * as should from 'should';
import { IPlatformService, CommandOptions } from '../../services/platformService';
import { AzdataService } from '../../services/azdataService';
import { BdcDeploymentType } from '../../interfaces';
describe('azdata service Tests', function (): void {
it('azdata service handles deployment types properly', async () => {
const mockPlatformService = TypeMoq.Mock.ofType<IPlatformService>();
const azdataService = new AzdataService(mockPlatformService.object);
mockPlatformService.setup((service) => service.runCommand(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns((command: string, options: CommandOptions | undefined) => {
return new Promise<string>((resolve) => {
resolve('{"result":[]}');
});
});
azdataService.getDeploymentProfiles(BdcDeploymentType.ExistingAKS);
azdataService.getDeploymentProfiles(BdcDeploymentType.ExistingARO);
azdataService.getDeploymentProfiles(BdcDeploymentType.ExistingKubeAdm);
azdataService.getDeploymentProfiles(BdcDeploymentType.ExistingOpenShift);
azdataService.getDeploymentProfiles(BdcDeploymentType.NewAKS);
should(azdataService.getDeploymentProfiles(<BdcDeploymentType>'no-such-type')).rejected();
mockPlatformService.verify((service) => service.runCommand(TypeMoq.It.isAnyString(), TypeMoq.It.isAny()), TypeMoq.Times.exactly(5));
});
it('azdata service returns correct deployment profiles', async () => {
const mockPlatformService = TypeMoq.Mock.ofType<IPlatformService>();
const azdataService = new AzdataService(mockPlatformService.object);
mockPlatformService.setup((service => service.storagePath())).returns(() => {
return '';
});
mockPlatformService.setup((service => service.readTextFile(TypeMoq.It.isAnyString()))).returns((path: string) => {
return new Promise<string>((resolve) => {
resolve('{}');
});
});
mockPlatformService.setup((service) => service.runCommand(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns((command: string, options: CommandOptions | undefined) => {
if (command === 'azdata bdc config list -o json') {
return Promise.resolve('{"result":["aks-1","profile-2"]}');
} else if (command.startsWith('azdata bdc config init')) {
return Promise.resolve('');
}
else {
return Promise.reject(`unexpected command: ${command}`);
}
});
const profiles = await azdataService.getDeploymentProfiles(BdcDeploymentType.NewAKS);
should(profiles.length).be.exactly(1);
});
});

View File

@@ -24,13 +24,13 @@ describe('Resource Type Service Tests', function (): void {
// index 0: platform name, index 1: expected resource types
const platforms: { platform: string; resourceTypes: string[] }[] = [
{
platform: 'win32', resourceTypes: ['sql-image', 'sql-bdc', 'sql-windows-setup']
platform: 'win32', resourceTypes: ['sql-image', 'sql-windows-setup']
},
{
platform: 'darwin', resourceTypes: ['sql-image', 'sql-bdc']
platform: 'darwin', resourceTypes: ['sql-image']
},
{
platform: 'linux', resourceTypes: ['sql-image', 'sql-bdc']
platform: 'linux', resourceTypes: ['sql-image']
}
];
platforms.forEach(platformInfo => {

View File

@@ -9,14 +9,12 @@ import * as TypeMoq from 'typemoq';
import { ToolsService } from '../../services/toolsService';
import { ITool, ToolType } from '../../interfaces';
import { IPlatformService } from '../../services/platformService';
import { AzdataToolName } from '../../services/tools/azdataTool';
const tools: { name: string; type: ToolType }[] = [
{ name: 'azure-cli', type: ToolType.AzCli },
{ name: 'docker', type: ToolType.Docker },
{ name: 'kubectl', type: ToolType.KubeCtl },
{ name: AzdataToolName, type: ToolType.Azdata }
{ name: 'kubectl', type: ToolType.KubeCtl }
];
const mockPlatformService = TypeMoq.Mock.ofType<IPlatformService>();
const toolsService = new ToolsService(mockPlatformService.object);