Skip to content

Commit

Permalink
add clickable show logs on discovery error (microsoft#22199)
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd authored Oct 11, 2023
1 parent 56661a1 commit bc0c714
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/client/testing/testController/common/resultResolver.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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}`);
Expand Down

0 comments on commit bc0c714

Please sign in to comment.