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

"]633;SetMark;Id=s0;Hidden" shows up in Test Peek Error windows #166270

Closed
DanTup opened this issue Nov 14, 2022 · 5 comments · Fixed by #173222
Closed

"]633;SetMark;Id=s0;Hidden" shows up in Test Peek Error windows #166270

DanTup opened this issue Nov 14, 2022 · 5 comments · Fixed by #173222
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders testing Built-in testing support verified Verification succeeded
Milestone

Comments

@DanTup
Copy link
Contributor

DanTup commented Nov 14, 2022

When I'm running tests recently, I'm seeing this weird markup show up in the "Peek Error" pane:

Screenshot 2022-11-14 at 11 25 52

This markup is not in the original text I'm providing to the TestRun.appendOutput call, but it looks like it's something VS Code is using itself:

const getMarkCode = (marker: number, start: boolean) => `\x1b]633;SetMark;Id=${getMarkId(marker, start)};Hidden\x07`;

I'm not sure what's triggering it (it doesn't seem to show up in all output messages, only some) but perhaps @connor4312 (who seems to have worked on that code) will understand what's going on.

@DanTup
Copy link
Contributor Author

DanTup commented Nov 14, 2022

Also, I don't know if it's related, but the last item seems to be duplicated in the test output compared to what was sent to appendOutput:

Screenshot 2022-11-14 at 11 32 25

@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug testing Built-in testing support labels Nov 14, 2022
@fabioz
Copy link
Contributor

fabioz commented Dec 12, 2022

This happens to me too.

@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Feb 3, 2023
@vscodenpa vscodenpa added this to the February 2023 milestone Feb 3, 2023
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Feb 3, 2023
@DanTup
Copy link
Contributor Author

DanTup commented Feb 8, 2023

@connor4312 thanks! The markers are gone, although I still see the last item duplicated (the last one has line numbers but the one before does not, oddly). Not sure if I'm causing this or not?

Feb-08-2023 16-23-07

@aeschli
Copy link
Contributor

aeschli commented Feb 23, 2023

Marking as verified as the fix for the original issue got verified.

@DanTup Can you file a new issue for the duplicate entry?

@aeschli aeschli added the verified Verification succeeded label Feb 23, 2023
@DanTup
Copy link
Contributor Author

DanTup commented Feb 27, 2023

Turns out, the duplication is kinda my fault, but I don't think I can improve it so I'm interested in ideas.

My test runner sends events for output, including error output, and then a failure status at the end:

  1. output: message 1
  2. error output: expectation failed
  3. test failed

The duplication comes because I write all output events as they arrive using TestRun.appendOutput, but the current API for TestRun.failed() also requires a message, so I'm giving it the last one again.

TestRun.failed() can also take an array of messages, but if I give it an empty array, then the Peek Error window doesn't open like it does if it's given a message.

There doesn't seem a great solution to this from my side. I'd rather not try to buffer messages because they could lead to a delay in the user seeing output, or events appearing out of order if not done correctly. Is it feasible VS Code could support some way to disconnect marking a test as failed from its error output? For example an appendErrorOutput() and then allowing a TestRun.failed() without output, and it can just use the last event itself?

@connor4312

@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders testing Built-in testing support verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@fabioz @DanTup @connor4312 @aeschli @vscodenpa and others