-
Notifications
You must be signed in to change notification settings - Fork 645
Use tasks & terminals to run tests to get colorized output #2003
Comments
The test output was never colorized in the first place :) How does the test output look when you run it in a terminal? |
@ramya-rao-a a random example: |
I managed to disable the colored output in this case by using the following setting:
|
Hi there, what are the arguments against making colorization available here? |
As mentioned in #2003 (comment), colorization never worked in the output channel for test output. The example in #2003 (comment) is from running the tests in a terminal directly. To show colors in the output channel, we need to provide a grammar to parse the contents first. Another alternative is to run the tests in a terminal using tasks |
Ok, thanks for the clarification. |
To achieve the colors, this extension should use tasks to run the tests and show the output in the integrated terminal which is capable of showing the colors. |
It seems the current code to run Go tests rewrites package paths in the output to be full paths, I guess that's so they are clickable. VS Code tasks currently require running a process or a shell command, and won't support this easily (Without sticking an intermediate process wrapping |
@segevfiner do you refer to microsoft/vscode#76492 ? Now that it has been implemented into vscode, is it possible to solve this issue ? |
Yeah. It was possible before minus the feature that rewrites paths in the output (Without introducing a binary/script that does so and invoking a shell pipeline that runs it and Personally I had trouble wrapping my head around the task API and task providers to figure out how to do this and coming up with how to introduce that to the existing code. |
Looking into this even further. I noticed that the official Python extension has a test explorer UI for running tests. Strangely enough, it is completely custom built inside the Python extension while there is also a third-party extension implementing a similar UI: https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer for the use of other extensions. Not sure how test execution and output is handled in those test explorer implementations. |
Any updates on this? I'd give this feature request a +1. I use a tool called {
"label": "Test Go Code",
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"command": "richgo",
"args": [
"test",
"???"
],
}, |
Hello all, We are in the midst of a repo move, see We are moving section in our readme for more details. Since there are no clear steps on how to implement this, I will be closing this issue. Thanks for all the support & Happy Coding! |
@ramya-rao-a I still believe it is a good idea to improve the way tests are being run, supporting colors, etc. But not sure what the implementation should be so as to create an issue. It might take someone who is more familiar with VS Code extensions, or authors one, to help here. As I described previously the situations with the test explorers and that it is unclear what's the recommended way for extensions to handle tests. |
I agree @segevfiner @hyangah, @stamblerre, Do you want to consider having an issue to evaluate how we run tests and the possible improvements we can do there regarding displaying the output? It can include to explore how the test explorer extensions do this and take a look at tasks as well |
Yep that makes sense, thanks @segevfiner. Filed golang/vscode-go#187. |
Steps to reproduce
I disabled all other plugins which might cause an issue, but it still doesn't work. (Should this even work?)
The text was updated successfully, but these errors were encountered: