Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt ensureNoDisposablesAreLeakedInTestSuite #202245

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@
"src/vs/workbench/services/keybinding/test/node/fallbackKeyboardMapper.test.ts",
"src/vs/workbench/services/keybinding/test/node/macLinuxKeyboardMapper.test.ts",
"src/vs/workbench/services/keybinding/test/node/windowsKeyboardMapper.test.ts",
"src/vs/workbench/services/telemetry/test/browser/commonProperties.test.ts",
"src/vs/workbench/services/userActivity/test/browser/domActivityTracker.test.ts",
"src/vs/workbench/test/browser/quickAccess.test.ts"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/browser/workbenchCommonProperties';
import { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage';
import { InMemoryStorageService } from 'vs/platform/storage/common/storage';
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';

suite('Browser Telemetry - common properties', function () {

const commit: string = (undefined)!;
const version: string = (undefined)!;
let testStorageService: IStorageService;
let testStorageService: InMemoryStorageService;

teardown(() => {
testStorageService.dispose();
});

ensureNoDisposablesAreLeakedInTestSuite();

setup(() => {
testStorageService = new InMemoryStorageService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
import * as assert from 'assert';
import { release, hostname } from 'os';
import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/common/workbenchCommonProperties';
import { IStorageService, StorageScope, InMemoryStorageService, StorageTarget } from 'vs/platform/storage/common/storage';
import { StorageScope, InMemoryStorageService, StorageTarget } from 'vs/platform/storage/common/storage';
import { timeout } from 'vs/base/common/async';
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';

suite('Telemetry - common properties', function () {
const commit: string = (undefined)!;
const version: string = (undefined)!;
let testStorageService: IStorageService;
let testStorageService: InMemoryStorageService;

setup(() => {
testStorageService = new InMemoryStorageService();
teardown(() => {
testStorageService.dispose();
});

ensureNoDisposablesAreLeakedInTestSuite();

setup(() => {
testStorageService = new InMemoryStorageService();
});

test('default', function () {
const props = resolveWorkbenchCommonProperties(testStorageService, release(), hostname(), commit, version, 'someMachineId', 'someSqmId', false, process);
assert.ok('commitHash' in props);
Expand Down