Change:
Currently, messages that are shown when tests fail can only be shown at a single . Often (, , among others) folks want to see the full call stack of the test failure. I propose some API to add this information:
does this track that not only the stack but stack + any stdout would show in same UX? /cc
Yes, output is already trackable and associable to a test case via the API
We are using to record all stdout written by tests. In addition, the is used to record the failure message and stack for each test failure.
UI:
Just check with Joh and this looks good to move into finalized!
do we want to bundle this with any of the other testing proposals (, )?

Discussion:
enqueueExitBlocker( (async () => { const stackInfo = await deriveStackLocations(store, rawErr, tcase!); <del> let message: vscode.TestMessage2; </del> <ins> let message: vscode.TestMessage; </ins> if (hasDiff) { message = new vscode.TestMessage(tryMakeMarkdown(err));

"src/**/*", "../../../src/vscode-dts/vscode.d.ts", "../../../src/vscode-dts/vscode.proposed.testObserver.d.ts", <del> "../../../src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts", </del> "../../../src/vscode-dts/vscode.proposed.testRelatedCode.d.ts", "../../../src/vscode-dts/vscode.proposed.attributableCoverage.d.ts" ]

terminalSelection: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts', }, <del> testMessageStackTrace: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts', }, </del> testObserver: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts', },

TestResultState: extHostTypes.TestResultState, TestRunRequest: extHostTypes.TestRunRequest, TestMessage: extHostTypes.TestMessage, <del> TestMessage2: extHostTypes.TestMessage, </del> TestMessageStackFrame: extHostTypes.TestMessageStackFrame, TestTag: extHostTypes.TestTag, TestRunProfileKind: extHostTypes.TestRunProfileKind,

actual: message.actualOutput, contextValue: message.contextValue, location: message.location && ({ range: Range.from(message.location.range), uri: message.location.uri }), <del> stackTrace: (message as vscode.TestMessage2).stackTrace?.map(s => ({ </del> <ins> stackTrace: message.stackTrace?.map(s => ({ </ins> label: s.label, position: s.position && Position.from(s.position), uri: s.uri && URI.revive(s.uri).toJSON(),

} /** <ins> * A stack frame found in the {@link TestMessage.stackTrace}. */ export class TestMessageStackFrame { /** * The location of this stack frame. This should be provided as a URI if the * location of the call frame can be accessed by the editor. */ uri?: Uri; /** * Position of the stack frame within the file. */ position?: Position; /** * The name of the stack frame, typically a method or function name. */ label: string; /** * @param label The name of the stack frame * @param file The file URI of the stack frame * @param position The position of the stack frame within the file */ constructor(label: string, uri?: Uri, position?: Position); } /** </ins> * Message associated with the test state. Can be linked to a specific * source range -- useful for assertion failures, for example. */

contextValue?: string; /** <ins> * The stack trace associated with the message or failure. */ stackTrace?: TestMessageStackFrame[]; /** </ins> * Creates a new TestMessage that will present as a diff in the editor. * @param message Message to display to the user. * @param expected Expected output.

<del> /*--------------------------------------------------------------------------------------------- *  Copyright (c) Microsoft Corporation. All rights reserved. *  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ declare module 'vscode' { export class TestMessage2 extends TestMessage { /** * The stack trace associated with the message or failure. */ stackTrace?: TestMessageStackFrame[]; } export class TestMessageStackFrame { /** * The location of this stack frame. This should be provided as a URI if the * location of the call frame can be accessed by the editor. */ uri?: Uri; /** * Position of the stack frame within the file. */ position?: Position; /** * The name of the stack frame, typically a method or function name. */ label: string; /** * @param label The name of the stack frame * @param file The file URI of the stack frame * @param position The position of the stack frame within the file */ constructor(label: string, uri?: Uri, position?: Position); } } </del>