-
Notifications
You must be signed in to change notification settings - Fork 645
Extra whitespace in running test output #1381
Comments
When you run the test command separately, you only see the stdout Can you run the same test command and see what you get in stderr? |
This can't be right. I am quite sure my terminal is showing both stderr and stdout, and as you can see in the command I used, I didn't redirect any streams. The "terminal" i am talking about is iTerm, not the one you built into vscode. Will look at the odiscussion in #1120
The output i showed in post 1 includes stdout and stderr. |
@ramya-rao-a #1120 is unrelated to this issue. in #1120, there is talk about stdout/stderr not showing up in test run output. This issue however, is, as you can see in post 1 about extra stuff showing up in test output. |
So, according to #1120 you no longer actually run "go test", so the command line you are showing is indeed not really what was run. That could explain the mysterious appearance of "assertions.go:239" as I mentioned in post 1. So, is this "go test package" also the one adding the whitespace? I am referrring to #1120 (comment) |
We dont literally run If you are up for it, I can help you debug this by running the extension code from source |
Dear @ramya-rao-a Thanks for your patience and clarifications! I made another observation that I think is relevant. When using go/testing, the internal testing system, vscode test output looks as expected. I only get these extra whitespace as in screenshot when using github.com/stretchr/testify/assert, a very popular third-party testing framework for go. Mini reproducable tiny_test.go: package tiny
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInternal(t *testing.T) {
if 1 != 2 {
t.Error("TestInternal marked failed")
}
}
func TestTestify(t *testing.T) {
assert.Equal(t, 1, 2, "TestTestify marked failed")
} Output from running file tests in vscode: Output from running the same command in zsh: And output from running the same command in zsh, with -v flag: |
Append stdout and stderr both are redirected to the "output" file You will see the blank lines |
@ramya-rao-a with Thanks again |
No problem, Happy Coding! |
When I click "run test" on a single test function in vscode, the output looks like this:
If I instead copy the command line that vscode claims to have used and run it in the terminal,
I get the following output:
First, there are a bunch of whitespace taking up space in my output window.
Secondly, the line "assertions.go:239" is confusing, since it is not present when running from terminal.
The text was updated successfully, but these errors were encountered: