Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -24,7 +24,7 @@ class AppInsightsMock implements ITelemetryClient {
}
class TestableLogService extends AbstractLogService implements ILogService {
_serviceBrand: any;
_serviceBrand: undefined;
public logs: string[] = [];

View File

@@ -31,7 +31,7 @@ suite('Telemetry - common properties', function () {
test.skip('default', async function () { // {{SQL CARBON EDIT}} skip test
await mkdirp(parentDir);
fs.writeFileSync(installSource, 'my.install.source');
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource);
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource);
assert.ok('commitHash' in props);
assert.ok('sessionID' in props);
assert.ok('timestamp' in props);
@@ -52,7 +52,7 @@ suite('Telemetry - common properties', function () {
assert.ok('common.instanceId' in props, 'instanceId');
assert.ok('common.machineId' in props, 'machineId');
fs.unlinkSync(installSource);
const props_1 = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource);
const props_1 = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource);
assert.ok(!('common.source' in props_1));
});
@@ -60,14 +60,14 @@ suite('Telemetry - common properties', function () {
testStorageService.store('telemetry.lastSessionDate', new Date().toUTCString(), StorageScope.GLOBAL);
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource);
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource);
assert.ok('common.lastSessionDate' in props); // conditional, see below
assert.ok('common.isNewSession' in props);
assert.equal(props['common.isNewSession'], 0);
});
test.skip('values chance on ask', async function () { // {{SQL CARBON EDIT}} skip test
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource);
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource);
let value1 = props['common.sequence'];
let value2 = props['common.sequence'];
assert.ok(value1 !== value2, 'seq');

View File

@@ -730,29 +730,29 @@ suite('TelemetryService', () => {
let service = new TelemetryService({
appender: testAppender
}, {
_serviceBrand: undefined,
getValue() {
return {
enableTelemetry: enableTelemetry
} as any;
},
updateValue(): Promise<void> {
return null!;
},
inspect(key: string) {
return {
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(): Promise<void> { return null!; },
getConfigurationData() { return null; }
});
_serviceBrand: undefined,
getValue() {
return {
enableTelemetry: enableTelemetry
} as any;
},
updateValue(): Promise<void> {
return null!;
},
inspect(key: string) {
return {
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(): Promise<void> { return null!; },
getConfigurationData() { return null; }
});
assert.equal(service.isOptedIn, false);