Alanren/integration test (#3657)

* add an extension for integration tests

* setup ads before running test

* test setup

* test cases

* bash script

* shorter temp folder name

* code cleanup

* add commented out original code

* fix test error

* test result path

* rename results file

* change file path

* report smoke test results

* test stablize

* test stablization and configurable test servers

* fix smoke test error

* connection provider

* simplify the integration test script

* add comment

* fix tslint error

* address PR comments

* add temp log to check whether the environment variable is already set

* remove temp log

* move api definition to testapi typing file

* exclude integration tests extension

* address comments
This commit is contained in:
Alan Ren
2019-01-18 17:00:30 -08:00
committed by GitHub
parent 3e7a09c1e3
commit eb67b299de
47 changed files with 5668 additions and 107 deletions

View File

@@ -15,6 +15,9 @@ import * as TaskUtilities from 'sql/workbench/common/taskUtilities';
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { isUndefinedOrNull } from 'vs/base/common/types';
import { generateUuid } from 'vs/base/common/uuid';
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
@extHostNamedCustomer(SqlMainContext.MainThreadConnectionManagement)
export class MainThreadConnectionManagement implements MainThreadConnectionManagementShape {
@@ -28,6 +31,7 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
@IEditorService private _workbenchEditorService: IEditorService,
@IConnectionDialogService private _connectionDialogService: IConnectionDialogService,
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService
) {
if (extHostContext) {
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostConnectionManagement);
@@ -54,7 +58,7 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
public async $openConnectionDialog(providers: string[], initialConnectionProfile?: IConnectionProfile, connectionCompletionOptions?: sqlops.IConnectionCompletionOptions): Promise<sqlops.connection.Connection> {
let connectionProfile = await this._connectionDialogService.openDialogAndWait(this._connectionManagementService, { connectionType: 1, providers: providers }, initialConnectionProfile);
const connection = connectionProfile ? {
const connection = connectionProfile ? {
connectionId: connectionProfile.id,
options: connectionProfile.options,
providerName: connectionProfile.providerName
@@ -101,4 +105,23 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
};
return connection;
}
public $connect(connectionProfile: IConnectionProfile): Thenable<sqlops.ConnectionResult> {
let profile = new ConnectionProfile(this._capabilitiesService, connectionProfile);
profile.id = generateUuid();
return this._connectionManagementService.connectAndSaveProfile(profile, undefined, {
saveTheConnection: true,
showDashboard: true,
params: undefined,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
}).then((result) => {
return <sqlops.ConnectionResult>{
connected: result.connected,
connectionId: result.connected ? profile.id : undefined,
errorCode: result.errorCode,
errorMessage: result.errorMessage
};
});
}
}