sqlproj publish to container - october release improvements (#17289)

This commit is contained in:
Leila Lali
2021-10-07 12:55:43 -07:00
committed by GitHub
parent 04ee2c5d83
commit f875699cd2
5 changed files with 67 additions and 29 deletions

View File

@@ -15,6 +15,7 @@ import * as childProcess from 'child_process';
import { AppSettingType, IDeployProfile } from '../../models/deploy/deployProfile';
let fse = require('fs-extra');
let path = require('path');
import * as constants from '../../common/constants';
export interface TestContext {
outputChannel: vscode.OutputChannel;
@@ -81,6 +82,7 @@ describe('deploy service', function (): void {
const deployService = new DeployService(testContext.outputChannel);
sandbox.stub(azdata.connection, 'connect').returns(Promise.resolve(mockConnectionResult));
sandbox.stub(azdata.connection, 'getUriForConnection').returns(Promise.resolve('connection'));
sandbox.stub(vscode.window, 'showWarningMessage').returns(<any>Promise.resolve(constants.yesString));
sandbox.stub(azdata.tasks, 'startBackgroundOperation').callThrough();
sandbox.stub(childProcess, 'exec').yields(undefined, 'id');
let connection = await deployService.deploy(deployProfile, project1);
@@ -168,10 +170,12 @@ describe('deploy service', function (): void {
}
};
const appInteg = {appSettingType: AppSettingType.AzureFunction,
const appInteg = {
appSettingType: AppSettingType.AzureFunction,
appSettingFile: filePath,
deploySettings: undefined,
envVariableName: 'SQLConnectionString'};
envVariableName: 'SQLConnectionString'
};
const deployService = new DeployService(testContext.outputChannel);
sandbox.stub(childProcess, 'exec').yields(undefined, 'id');
@@ -240,8 +244,8 @@ describe('deploy service', function (): void {
id2
id3`);
await deployService.cleanDockerObjects(`docker ps -q -a --filter label=test`, ['docker stop', 'docker rm']);
const ids = await deployService.getCurrentDockerContainer('label');
await deployService.cleanDockerObjects(ids, ['docker stop', 'docker rm']);
should(process.calledThrice);
});
});