mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 19:48:37 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -24,7 +24,7 @@ class AppInsightsMock implements ITelemetryClient {
|
||||
}
|
||||
|
||||
class TestableLogService extends AbstractLogService implements ILogService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
public logs: string[] = [];
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user