Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -10,7 +10,6 @@ import * as assert from 'assert';
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';
import { assign } from 'vs/base/common/objects';
suite('SQL ConnectionProfileInfo tests', () => {
let msSQLCapabilities: ConnectionProviderProperties;
@@ -187,7 +186,7 @@ suite('SQL ConnectionProfileInfo tests', () => {
});
test('createFromStoredProfile should set the id to new guid if not set in stored profile', () => {
let savedProfile: IConnectionProfileStore = assign({}, storedProfile, { id: undefined });
let savedProfile: IConnectionProfileStore = Object.assign({}, storedProfile, { id: undefined });
let connectionProfile = ConnectionProfile.createFromStoredProfile(savedProfile, capabilitiesService);
assert.equal(savedProfile.groupId, connectionProfile.groupId);
assert.deepEqual(savedProfile.providerName, connectionProfile.providerName);

View File

@@ -13,7 +13,7 @@ import { IConnectionProfile, ConnectionOptionSpecialType, ServiceOptionType } fr
import { TestConfigurationService } from 'sql/platform/connection/test/common/testConfigurationService';
import { TestCredentialsService } from 'sql/platform/credentials/test/common/testCredentialsService';
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
import { deepClone, deepFreeze, assign } from 'vs/base/common/objects';
import { deepClone, deepFreeze } from 'vs/base/common/objects';
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';
@@ -154,7 +154,7 @@ suite('ConnectionStore', () => {
const connectionStore = new ConnectionStore(storageService, configurationService,
credentialsService, capabilitiesService);
for (let i = 0; i < numCreds; i++) {
const cred = assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i });
const cred = Object.assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i });
const connectionProfile = new ConnectionProfile(capabilitiesService, cred);
await connectionStore.addRecentConnection(connectionProfile);
const current = connectionStore.getRecentlyUsedConnections();
@@ -190,7 +190,7 @@ suite('ConnectionStore', () => {
// Then expect the only 1 instance of that connection to be listed in the MRU
const connectionStore = new ConnectionStore(storageService, configurationService,
credentialsService, capabilitiesService);
const cred = assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + 1 });
const cred = Object.assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + 1 });
const connectionProfile = new ConnectionProfile(capabilitiesService, cred);
await connectionStore.addRecentConnection(defaultNamedConnectionProfile);
await connectionStore.addRecentConnection(connectionProfile);
@@ -212,13 +212,13 @@ suite('ConnectionStore', () => {
// Given we save 1 connection with password and multiple other connections without
const connectionStore = new ConnectionStore(storageService, configurationService,
credentialsService, capabilitiesService);
const integratedCred = assign({}, defaultNamedProfile, {
const integratedCred = Object.assign({}, defaultNamedProfile, {
serverName: defaultNamedProfile.serverName + 'Integrated',
authenticationType: 'Integrated',
userName: '',
password: ''
});
const noPwdCred = assign({}, defaultNamedProfile, {
const noPwdCred = Object.assign({}, defaultNamedProfile, {
serverName: defaultNamedProfile.serverName + 'NoPwd',
password: ''
});
@@ -322,7 +322,7 @@ suite('ConnectionStore', () => {
const connectionStore = new ConnectionStore(storageService, configurationService,
credentialsService, capabilitiesService);
const connectionProfile: IConnectionProfile = assign({}, defaultNamedProfile, { providerName: providerName });
const connectionProfile: IConnectionProfile = Object.assign({}, defaultNamedProfile, { providerName: providerName });
assert.ok(!connectionStore.isPasswordRequired(connectionProfile));
});
@@ -333,7 +333,7 @@ suite('ConnectionStore', () => {
const credentialsService = new TestCredentialsService();
const password: string = 'asdf!@#$';
const connectionProfile: IConnectionProfile = assign({}, defaultNamedProfile, { password });
const connectionProfile: IConnectionProfile = Object.assign({}, defaultNamedProfile, { password });
const connectionStore = new ConnectionStore(storageService, configurationService,
credentialsService, capabilitiesService);
@@ -403,7 +403,7 @@ suite('ConnectionStore', () => {
const profile = deepClone(defaultNamedProfile);
profile.options['password'] = profile.password;
profile.id = 'testId';
let expectedProfile = assign({}, profile);
let expectedProfile = Object.assign({}, profile);
expectedProfile.password = '';
expectedProfile.options['password'] = '';
expectedProfile = ConnectionProfile.fromIConnectionProfile(capabilitiesService, expectedProfile).toIConnectionProfile();
@@ -416,7 +416,7 @@ suite('ConnectionStore', () => {
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();
const profile = ConnectionProfile.fromIConnectionProfile(capabilitiesService, assign({}, defaultNamedProfile, { password: undefined }));
const profile = ConnectionProfile.fromIConnectionProfile(capabilitiesService, Object.assign({}, defaultNamedProfile, { password: undefined }));
const credId = `Microsoft.SqlTools|itemtype:Profile|id:${profile.getConnectionInfoId()}`;
const password: string = 'asdf!@#$';
@@ -477,7 +477,7 @@ suite('ConnectionStore', () => {
credentialsService, capabilitiesService);
for (let i = 0; i < 5; i++) {
const cred = assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i });
const cred = Object.assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i });
const connectionProfile = new ConnectionProfile(capabilitiesService, cred);
await connectionStore.addRecentConnection(connectionProfile);
const current = connectionStore.getRecentlyUsedConnections();
@@ -485,7 +485,7 @@ suite('ConnectionStore', () => {
}
for (let i = 0; i < 5; i++) {
const cred = assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i });
const cred = Object.assign({}, defaultNamedProfile, { serverName: defaultNamedProfile.serverName + i });
const connectionProfile = new ConnectionProfile(capabilitiesService, cred);
connectionStore.removeRecentConnection(connectionProfile);
const current = connectionStore.getRecentlyUsedConnections();

View File

@@ -9,7 +9,6 @@ import * as azdata from 'azdata';
import * as assert from 'assert';
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { assign } from 'vs/base/common/objects';
suite('SQL ProviderConnectionInfo tests', () => {
let msSQLCapabilities: any;
@@ -202,7 +201,7 @@ suite('SQL ProviderConnectionInfo tests', () => {
test('constructor should initialize the options given a valid model with options', () => {
let options: { [key: string]: string } = {};
options['encrypt'] = 'test value';
let conn2 = assign({}, connectionProfile, { options: options });
let conn2 = Object.assign({}, connectionProfile, { options: options });
let conn = new ProviderConnectionInfo(capabilitiesService, conn2);
assert.equal(conn.connectionName, conn2.connectionName);
@@ -223,7 +222,7 @@ suite('SQL ProviderConnectionInfo tests', () => {
test('getOptionsKey should create different id for different server names', () => {
let conn = new ProviderConnectionInfo(capabilitiesService, connectionProfile);
let conn2 = new ProviderConnectionInfo(capabilitiesService, assign({}, connectionProfile, { serverName: connectionProfile.serverName + '1' }));
let conn2 = new ProviderConnectionInfo(capabilitiesService, Object.assign({}, connectionProfile, { serverName: connectionProfile.serverName + '1' }));
assert.notEqual(conn.getOptionsKey(), conn2.getOptionsKey());
});

View File

@@ -15,7 +15,6 @@ import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { NullLogService } from 'vs/platform/log/common/log';
import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
import { assign } from 'vs/base/common/objects';
import product from 'vs/platform/product/common/product';
let connections: ConnectionStatusManager;
@@ -171,7 +170,7 @@ suite('SQL ConnectionStatusManager tests', () => {
let expectedConnectionId = 'new id';
connections.addConnection(connectionProfile, connection1Id);
let updatedConnection = assign({}, connectionProfile, { groupId: expected, getOptionsKey: () => connectionProfile.getOptionsKey() + expected, id: expectedConnectionId });
let updatedConnection = Object.assign({}, connectionProfile, { groupId: expected, getOptionsKey: () => connectionProfile.getOptionsKey() + expected, id: expectedConnectionId });
let actualId = connections.updateConnectionProfile(updatedConnection, connection1Id);
let newId = Utils.generateUri(updatedConnection);
@@ -246,7 +245,7 @@ suite('SQL ConnectionStatusManager tests', () => {
test('getActiveConnectionProfiles should return a list of all the unique connections that the status manager knows about', () => {
// Add duplicate connections
let newConnection = assign({}, connectionProfile);
let newConnection = Object.assign({}, connectionProfile);
newConnection.id = 'test_id';
newConnection.serverName = 'new_server_name';
newConnection.options['databaseDisplayName'] = newConnection.databaseName;