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

Go Tests Are Verbose By Default #471

Closed
swtch1 opened this issue Aug 4, 2020 · 5 comments
Closed

Go Tests Are Verbose By Default #471

swtch1 opened this issue Aug 4, 2020 · 5 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@swtch1
Copy link

swtch1 commented Aug 4, 2020

Please direct general questions to:

Please review the documentation before filing an issue.
Helpful pages include:

Please answer these questions before submitting your issue. Thanks!

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.14.4 linux/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.47.1
      485c41f9460bdb830c4da12c102daff275415b53
      x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.16.0
  • Run go env to get the go development environment details

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/josh/.cache/go-build"
GOENV="/home/josh/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="bitbucket.org"
GONOSUMDB="bitbucket.org"
GOOS="linux"
GOPATH="/home/josh/go"
GOPRIVATE="bitbucket.org"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build567801905=/tmp/go-build -gno-record-gcc-switches"

Share the Go related settings you have added/edited

Ran with all vscode settings disabled.

Describe the bug

What I did:
Use any of the Go: Test ... commands

What did I expect:
For go test to run with less verbosity

What happend:
Go test appears to run increased verbosity, as if the -v flag is being implicitly passed to go test.

Steps to reproduce the behavior:

  • Install vscode-go v0.16.0
  • Ensure vscode-go settings do not include -v flag.
  • Execute Go: Test All Packages In Workspace command

v0.16.0
image

v0.15.2
image

@hyangah
Copy link
Contributor

hyangah commented Aug 4, 2020

@swtch1 thanks for the report. This is an oversight while transitioning to use go test -json underneath.
If -v is not specified, we should suppress output from successful tests.

@hyangah hyangah added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 4, 2020
@hyangah hyangah added this to the v0.16.1 milestone Aug 4, 2020
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/246918 mentions this issue: src/testUtil.ts: switch to -json mode only if -v is set

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/247017 mentions this issue: [release] src/testUtil.ts: switch to -json mode only if -v is set

gopherbot pushed a commit that referenced this issue Aug 5, 2020
CL/242540 made runTest uses -json mode to ease streaming
test output processing. However, it turned out -json makes
the test output more verbose than the standard test output.
(golang/go#40588)

Verbose output by default is not ideal especially when
running tests on many packages. This change brings back
the old test output processing logic when users do not use
the `-v` flag. The `go test` command will stream test
output only if the `-v` flag is specified, so the original
issue CL/242540 remains addressed.

Fixes #471
Updates #316
Updates golang/go#40588

Change-Id: I29d6d1319acccab2457300c118216ceebb4c4033
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/246918
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Rebecca Stambler <[email protected]>
(cherry picked from commit bec9cf3)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/247017
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
@leguminosa
Copy link

leguminosa commented Aug 14, 2020

Hello @hyangah I am already using v0.16.1 but I still face this problem, it output all logs from the code, but it doesn't verbose out the go test log (such as === RUN etc).

Usually, the output is verboseless, and I haven't changed any configs at all.

@hyangah
Copy link
Contributor

hyangah commented Aug 14, 2020

@leguminosa can you open a new issue and share your settings and the Go Test output?

@golang golang locked and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants