mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -9,8 +9,8 @@ import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppen
|
||||
|
||||
interface IAppInsightsEvent {
|
||||
eventName: string;
|
||||
properties?: { string?: string; };
|
||||
measurements?: { string?: number; };
|
||||
properties?: { [x: string]: string; };
|
||||
measurements?: { [x: string]: number; };
|
||||
}
|
||||
|
||||
class AppInsightsMock {
|
||||
@@ -34,7 +34,7 @@ class AppInsightsMock {
|
||||
this.exceptions.push(exception);
|
||||
}
|
||||
|
||||
public sendPendingData(callback): void {
|
||||
public sendPendingData(_callback: any): void {
|
||||
// called on dispose
|
||||
}
|
||||
}
|
||||
@@ -74,18 +74,18 @@ suite('AIAdapter', () => {
|
||||
|
||||
test('property limits', () => {
|
||||
var reallyLongPropertyName = 'abcdefghijklmnopqrstuvwxyz';
|
||||
for (var i = 0; i < 6; i++) {
|
||||
for (let i = 0; i < 6; i++) {
|
||||
reallyLongPropertyName += 'abcdefghijklmnopqrstuvwxyz';
|
||||
}
|
||||
assert(reallyLongPropertyName.length > 150);
|
||||
|
||||
var reallyLongPropertyValue = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123';
|
||||
for (var i = 0; i < 21; i++) {
|
||||
for (let i = 0; i < 21; i++) {
|
||||
reallyLongPropertyValue += 'abcdefghijklmnopqrstuvwxyz012345678901234567890123';
|
||||
}
|
||||
assert(reallyLongPropertyValue.length > 1024);
|
||||
|
||||
var data = {};
|
||||
var data = Object.create(null);
|
||||
data[reallyLongPropertyName] = '1234';
|
||||
data['reallyLongPropertyValue'] = reallyLongPropertyValue;
|
||||
adapter.log('testEvent', data);
|
||||
|
||||
@@ -5,40 +5,52 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { resolveWorkbenchCommonProperties } from 'vs/platform/telemetry/node/workbenchCommonProperties';
|
||||
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
|
||||
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { getRandomTestPath } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { del } from 'vs/base/node/extfs';
|
||||
import { mkdirp } from 'vs/base/node/pfs';
|
||||
|
||||
suite('Telemetry - common properties', function () {
|
||||
const parentDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'telemetryservice');
|
||||
const installSource = path.join(parentDir, 'installSource');
|
||||
|
||||
const commit = void 0;
|
||||
const version = void 0;
|
||||
const source = void 0;
|
||||
let storageService;
|
||||
const commit: string = void 0;
|
||||
const version: string = void 0;
|
||||
let storageService: StorageService;
|
||||
|
||||
setup(() => {
|
||||
storageService = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace.id);
|
||||
});
|
||||
|
||||
teardown(done => {
|
||||
del(parentDir, os.tmpdir(), done);
|
||||
});
|
||||
|
||||
test('default', function () {
|
||||
return mkdirp(parentDir).then(() => {
|
||||
fs.writeFileSync(installSource, 'my.install.source');
|
||||
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, source).then(props => {
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, 'someMachineId', installSource).then(props => {
|
||||
assert.ok('commitHash' in props);
|
||||
assert.ok('sessionID' in props);
|
||||
assert.ok('timestamp' in props);
|
||||
assert.ok('common.platform' in props);
|
||||
assert.ok('common.nodePlatform' in props);
|
||||
assert.ok('common.nodeArch' in props);
|
||||
assert.ok('common.timesincesessionstart' in props);
|
||||
assert.ok('common.sequence' in props);
|
||||
|
||||
assert.ok('commitHash' in props);
|
||||
assert.ok('sessionID' in props);
|
||||
assert.ok('timestamp' in props);
|
||||
assert.ok('common.platform' in props);
|
||||
assert.ok('common.nodePlatform' in props);
|
||||
assert.ok('common.nodeArch' in props);
|
||||
assert.ok('common.timesincesessionstart' in props);
|
||||
assert.ok('common.sequence' in props);
|
||||
|
||||
// assert.ok('common.version.shell' in first.data); // only when running on electron
|
||||
// assert.ok('common.version.renderer' in first.data);
|
||||
assert.ok('common.osVersion' in props, 'osVersion');
|
||||
assert.ok('version' in props);
|
||||
assert.ok('common.source' in props);
|
||||
// assert.ok('common.version.shell' in first.data); // only when running on electron
|
||||
// assert.ok('common.version.renderer' in first.data);
|
||||
assert.ok('common.osVersion' in props, 'osVersion');
|
||||
assert.ok('version' in props);
|
||||
assert.equal(props['common.source'], 'my.install.source');
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
assert.ok('common.application.name' in props);
|
||||
@@ -47,10 +59,16 @@ suite('Telemetry - common properties', function () {
|
||||
assert.ok('common.lastSessionDate' in props, 'lastSessionDate'); // conditional, see below, 'lastSessionDate'ow
|
||||
assert.ok('common.isNewSession' in props, 'isNewSession');
|
||||
|
||||
// machine id et al
|
||||
assert.ok('common.instanceId' in props, 'instanceId');
|
||||
assert.ok('common.machineId' in props, 'machineId');
|
||||
// machine id et al
|
||||
assert.ok('common.instanceId' in props, 'instanceId');
|
||||
assert.ok('common.machineId' in props, 'machineId');
|
||||
|
||||
fs.unlinkSync(installSource);
|
||||
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, 'someMachineId', installSource).then(props => {
|
||||
assert.ok(!('common.source' in props));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -58,7 +76,7 @@ suite('Telemetry - common properties', function () {
|
||||
|
||||
storageService.store('telemetry.lastSessionDate', new Date().toUTCString());
|
||||
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, source).then(props => {
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, 'someMachineId', installSource).then(props => {
|
||||
|
||||
assert.ok('common.lastSessionDate' in props); // conditional, see below
|
||||
assert.ok('common.isNewSession' in props);
|
||||
@@ -67,7 +85,7 @@ suite('Telemetry - common properties', function () {
|
||||
});
|
||||
|
||||
test('values chance on ask', function () {
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, source).then(props => {
|
||||
return resolveWorkbenchCommonProperties(storageService, commit, version, 'someMachineId', installSource).then(props => {
|
||||
let value1 = props['common.sequence'];
|
||||
let value2 = props['common.sequence'];
|
||||
assert.ok(value1 !== value2, 'seq');
|
||||
|
||||
@@ -40,16 +40,16 @@ class TestTelemetryAppender implements ITelemetryAppender {
|
||||
}
|
||||
|
||||
class ErrorTestingSettings {
|
||||
public personalInfo;
|
||||
public importantInfo;
|
||||
public filePrefix;
|
||||
public dangerousPathWithoutImportantInfo;
|
||||
public dangerousPathWithImportantInfo;
|
||||
public missingModelPrefix;
|
||||
public missingModelMessage;
|
||||
public noSuchFilePrefix;
|
||||
public noSuchFileMessage;
|
||||
public stack;
|
||||
public personalInfo: string;
|
||||
public importantInfo: string;
|
||||
public filePrefix: string;
|
||||
public dangerousPathWithoutImportantInfo: string;
|
||||
public dangerousPathWithImportantInfo: string;
|
||||
public missingModelPrefix: string;
|
||||
public missingModelMessage: string;
|
||||
public noSuchFilePrefix: string;
|
||||
public noSuchFileMessage: string;
|
||||
public stack: string[];
|
||||
|
||||
constructor() {
|
||||
this.personalInfo = 'DANGEROUS/PATH';
|
||||
@@ -203,7 +203,7 @@ suite('TelemetryService', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
test('Error events', sinon.test(function () {
|
||||
test('Error events', sinon.test(function (this: any) {
|
||||
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
@@ -262,7 +262,7 @@ suite('TelemetryService', () => {
|
||||
// }
|
||||
// }));
|
||||
|
||||
test('Handle global errors', sinon.test(function () {
|
||||
test('Handle global errors', sinon.test(function (this: any) {
|
||||
let errorStub = sinon.stub();
|
||||
window.onerror = errorStub;
|
||||
|
||||
@@ -289,7 +289,7 @@ suite('TelemetryService', () => {
|
||||
service.dispose();
|
||||
}));
|
||||
|
||||
test('Uncaught Error Telemetry removes PII from filename', sinon.test(function () {
|
||||
test('Uncaught Error Telemetry removes PII from filename', sinon.test(function (this: any) {
|
||||
let errorStub = sinon.stub();
|
||||
window.onerror = errorStub;
|
||||
let settings = new ErrorTestingSettings();
|
||||
@@ -318,7 +318,7 @@ suite('TelemetryService', () => {
|
||||
service.dispose();
|
||||
}));
|
||||
|
||||
test('Unexpected Error Telemetry removes PII', sinon.test(function () {
|
||||
test('Unexpected Error Telemetry removes PII', sinon.test(function (this: any) {
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
try {
|
||||
@@ -348,7 +348,7 @@ suite('TelemetryService', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
test('Uncaught Error Telemetry removes PII', sinon.test(function () {
|
||||
test('Uncaught Error Telemetry removes PII', sinon.test(function (this: any) {
|
||||
let errorStub = sinon.stub();
|
||||
window.onerror = errorStub;
|
||||
let settings = new ErrorTestingSettings();
|
||||
@@ -374,7 +374,7 @@ suite('TelemetryService', () => {
|
||||
service.dispose();
|
||||
}));
|
||||
|
||||
test('Unexpected Error Telemetry removes PII but preserves Code file path', sinon.test(function () {
|
||||
test('Unexpected Error Telemetry removes PII but preserves Code file path', sinon.test(function (this: any) {
|
||||
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
@@ -409,7 +409,7 @@ suite('TelemetryService', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function () {
|
||||
test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function (this: any) {
|
||||
let errorStub = sinon.stub();
|
||||
window.onerror = errorStub;
|
||||
let settings = new ErrorTestingSettings();
|
||||
@@ -437,7 +437,7 @@ suite('TelemetryService', () => {
|
||||
service.dispose();
|
||||
}));
|
||||
|
||||
test('Unexpected Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () {
|
||||
test('Unexpected Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function (this: any) {
|
||||
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
@@ -472,7 +472,7 @@ suite('TelemetryService', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () {
|
||||
test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function (this: any) {
|
||||
let errorStub = sinon.stub();
|
||||
window.onerror = errorStub;
|
||||
let settings = new ErrorTestingSettings();
|
||||
@@ -500,7 +500,7 @@ suite('TelemetryService', () => {
|
||||
service.dispose();
|
||||
}));
|
||||
|
||||
test('Unexpected Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () {
|
||||
test('Unexpected Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function (this: any) {
|
||||
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
@@ -535,7 +535,7 @@ suite('TelemetryService', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () {
|
||||
test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function (this: any) {
|
||||
let errorStub = sinon.stub();
|
||||
window.onerror = errorStub;
|
||||
let settings = new ErrorTestingSettings();
|
||||
@@ -564,7 +564,7 @@ suite('TelemetryService', () => {
|
||||
service.dispose();
|
||||
}));
|
||||
|
||||
test('Unexpected Error Telemetry removes PII but preserves No Such File error message', sinon.test(function () {
|
||||
test('Unexpected Error Telemetry removes PII but preserves No Such File error message', sinon.test(function (this: any) {
|
||||
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
@@ -599,7 +599,7 @@ suite('TelemetryService', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
test('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(function () {
|
||||
test('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(function (this: any) {
|
||||
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
|
||||
Errors.setUnexpectedErrorHandler(() => { });
|
||||
|
||||
@@ -676,29 +676,26 @@ suite('TelemetryService', () => {
|
||||
appender: testAppender
|
||||
}, {
|
||||
_serviceBrand: undefined,
|
||||
getConfiguration() {
|
||||
getValue() {
|
||||
return {
|
||||
enableTelemetry: enableTelemetry
|
||||
} as any;
|
||||
},
|
||||
getValue(key) {
|
||||
return getConfigurationValue(this.getConfiguration(), key);
|
||||
},
|
||||
updateValue() {
|
||||
updateValue(): TPromise<void> {
|
||||
return null;
|
||||
},
|
||||
inspect(key: string) {
|
||||
return {
|
||||
value: getConfigurationValue(this.getConfiguration(), key),
|
||||
default: getConfigurationValue(this.getConfiguration(), key),
|
||||
user: getConfigurationValue(this.getConfiguration(), key),
|
||||
value: getConfigurationValue(this.getValue(), key),
|
||||
default: getConfigurationValue(this.getValue(), key),
|
||||
user: getConfigurationValue(this.getValue(), key),
|
||||
workspace: null,
|
||||
workspaceFolder: null
|
||||
};
|
||||
},
|
||||
keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; },
|
||||
onDidChangeConfiguration: emitter.event,
|
||||
reloadConfiguration() { return null; },
|
||||
reloadConfiguration(): TPromise<void> { return null; },
|
||||
getConfigurationData() { return null; }
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user