diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index ff3e1babd78..f39b6920640 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -202,7 +202,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I const extHostWebviewPanels = rpcProtocol.set(ExtHostContext.ExtHostWebviewPanels, new ExtHostWebviewPanels(rpcProtocol, extHostWebviews, extHostWorkspace)); const extHostCustomEditors = rpcProtocol.set(ExtHostContext.ExtHostCustomEditors, new ExtHostCustomEditors(rpcProtocol, extHostDocuments, extensionStoragePaths, extHostWebviews, extHostWebviewPanels)); const extHostWebviewViews = rpcProtocol.set(ExtHostContext.ExtHostWebviewViews, new ExtHostWebviewViews(rpcProtocol, extHostWebviews)); - const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol, extHostCommands, extHostDocumentsAndEditors)); + const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol, extHostLogService, extHostCommands, extHostDocumentsAndEditors)); const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol)); const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol)); rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService)); diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index b84fb025706..22c3ec80d4f 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -17,6 +17,7 @@ import { deepFreeze } from 'vs/base/common/objects'; import { isDefined } from 'vs/base/common/types'; import { generateUuid } from 'vs/base/common/uuid'; import { IExtensionDescription, IRelaxedExtensionDescription } from 'vs/platform/extensions/common/extensions'; +import { ILogService } from 'vs/platform/log/common/log'; import { ExtHostTestingShape, ILocationDto, MainContext, MainThreadTestingShape } from 'vs/workbench/api/common/extHost.protocol'; import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; @@ -54,13 +55,14 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { constructor( @IExtHostRpcService rpc: IExtHostRpcService, + @ILogService logService: ILogService, commands: ExtHostCommands, private readonly editors: ExtHostDocumentsAndEditors, ) { super(); this.proxy = rpc.getProxy(MainContext.MainThreadTesting); this.observer = new TestObservers(this.proxy); - this.runTracker = new TestRunCoordinator(this.proxy); + this.runTracker = new TestRunCoordinator(this.proxy, logService); commands.registerArgumentProcessor({ processArgument: arg => { @@ -465,6 +467,7 @@ class TestRunTracker extends Disposable { private readonly dto: TestRunDto, private readonly proxy: MainThreadTestingShape, private readonly extension: IRelaxedExtensionDescription, + private readonly logService: ILogService, parentToken?: CancellationToken, ) { super(); @@ -496,7 +499,7 @@ class TestRunTracker extends Disposable { const guardTestMutation = (fn: (test: vscode.TestItem, ...args: Args) => void) => (test: vscode.TestItem, ...args: Args) => { if (ended) { - console.warn(`Setting the state of test "${test.id}" is a no-op after the run ends.`); + this.logService.warn(`Setting the state of test "${test.id}" is a no-op after the run ends.`); return; } @@ -665,7 +668,10 @@ export class TestRunCoordinator { return this.tracked.values(); } - constructor(private readonly proxy: MainThreadTestingShape) { } + constructor( + private readonly proxy: MainThreadTestingShape, + private readonly logService: ILogService, + ) { } /** * Gets a coverage report for a given run and task ID. @@ -740,7 +746,7 @@ export class TestRunCoordinator { } private getTracker(req: vscode.TestRunRequest, dto: TestRunDto, extension: IRelaxedExtensionDescription, token?: CancellationToken) { - const tracker = new TestRunTracker(dto, this.proxy, extension, token); + const tracker = new TestRunTracker(dto, this.proxy, extension, this.logService, token); this.tracked.set(req, tracker); let coverageReports: CoverageReportRecord | undefined; diff --git a/src/vs/workbench/api/test/browser/extHostTesting.test.ts b/src/vs/workbench/api/test/browser/extHostTesting.test.ts index 11dfe6d72a1..c788ae54073 100644 --- a/src/vs/workbench/api/test/browser/extHostTesting.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTesting.test.ts @@ -608,7 +608,7 @@ suite('ExtHost Testing', () => { setup(async () => { proxy = mockObject()(); cts = new CancellationTokenSource(); - c = new TestRunCoordinator(proxy); + c = new TestRunCoordinator(proxy, new NullLogService()); configuration = new TestRunProfileImpl(mockObject()(), new Map(), nullExtensionDescription, new Set(), Event.None, 'ctrlId', 42, 'Do Run', TestRunProfileKind.Run, () => { }, false); @@ -893,6 +893,7 @@ suite('ExtHost Testing', () => { const rpcProtocol = AnyCallRPCProtocol(); ctrl = ds.add(new TestExtHostTesting( rpcProtocol, + new NullLogService(), new ExtHostCommands(rpcProtocol, new NullLogService(), new class extends mock() { override onExtensionError(): boolean { return true; diff --git a/test/unit/electron/renderer.js b/test/unit/electron/renderer.js index 0f389094cf7..61237ebd8e4 100644 --- a/test/unit/electron/renderer.js +++ b/test/unit/electron/renderer.js @@ -195,7 +195,6 @@ function loadTests(opts) { 'issue #149130: vscode freezes because of Bracket Pair Colorization', // https://github.com/microsoft/vscode/issues/192440 'property limits', // https://github.com/microsoft/vscode/issues/192443 'Error events', // https://github.com/microsoft/vscode/issues/192443 - 'guards calls after runs are ended' // https://github.com/microsoft/vscode/issues/192468 ]); let _testsWithUnexpectedOutput = false;