From bc0c7144d586d5a7514921ddfc8cd495f1838ba1 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 11 Oct 2023 10:18:16 -0700 Subject: [PATCH] add clickable show logs on discovery error (#22199) fixes https://github.com/microsoft/vscode-python/issues/22175 --- .../testController/common/resultResolver.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/client/testing/testController/common/resultResolver.ts b/src/client/testing/testController/common/resultResolver.ts index 79cee6452a8c..cf757d77243d 100644 --- a/src/client/testing/testController/common/resultResolver.ts +++ b/src/client/testing/testController/common/resultResolver.ts @@ -1,7 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { CancellationToken, TestController, TestItem, Uri, TestMessage, Location, TestRun } from 'vscode'; +import { + CancellationToken, + TestController, + TestItem, + Uri, + TestMessage, + Location, + TestRun, + MarkdownString, +} from 'vscode'; import * as util from 'util'; import { DiscoveredTestPayload, EOTTestPayload, ExecutionTestPayload, ITestResultResolver } from './types'; import { TestProvider } from '../../types'; @@ -78,7 +87,11 @@ export class PythonResultResolver implements ITestResultResolver { errorNode = createErrorTestItem(this.testController, options); this.testController.items.add(errorNode); } - errorNode.error = message; + const errorNodeLabel: MarkdownString = new MarkdownString( + `[Show output](command:python.viewOutput) to view error logs`, + ); + errorNodeLabel.isTrusted = true; + errorNode.error = errorNodeLabel; } else { // remove error node only if no errors exist. this.testController.items.delete(`DiscoveryError:${workspacePath}`);