Feature/project build (#10332)

* initial build command execution

* adding tests

* Clean up test names

* update SqltoolsService release in ADS for Build

* Updating as per PR comments

* updating yarn lock

* Adding one more test for command run

* Test fixes
This commit is contained in:
Udeesha Gautam
2020-05-12 20:17:37 -07:00
committed by GitHub
parent ab374e362a
commit ddb9a806cc
13 changed files with 319 additions and 22 deletions

View File

@@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as should from 'should';
import * as os from 'os';
import * as vscode from 'vscode';
import * as path from 'path';
import { BuildHelper } from '../tools/buildHelper';
describe('BuildHelper: Build Helper tests', function (): void {
it('Should get correct build arguments', async function (): Promise<void> {
// update settings and validate
const buildHelper = new BuildHelper();
const resultArg = buildHelper.constructBuildArguments('dummy\\project path\\more space in path', 'dummy\\dll path');
if (os.platform() === 'win32') {
should(resultArg).equal(' build "dummy\\\\project path\\\\more space in path" /p:NetCoreBuild=true /p:NETCoreTargetsPath="dummy\\\\dll path"');
}
else {
should(resultArg).equal(' build "dummy/project path/more space in path" /p:NetCoreBuild=true /p:NETCoreTargetsPath="dummy/dll path"');
}
});
it('Should get correct build folder', async function (): Promise<void> {
const buildHelper = new BuildHelper();
await buildHelper.createBuildDirFolder();
// get expected path for build
let expectedPath = vscode.extensions.getExtension('Microsoft.sql-database-projects')?.extensionPath ?? 'EmptyPath';
expectedPath = path.join(expectedPath, 'BuildDirectory');
should(buildHelper.extensionBuildDirPath).equal(expectedPath);
});
});