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

File not expanded into clickable fullpath on nested test #956

Closed
uudashr opened this issue Nov 24, 2020 · 2 comments
Closed

File not expanded into clickable fullpath on nested test #956

uudashr opened this issue Nov 24, 2020 · 2 comments

Comments

@uudashr
Copy link
Contributor

uudashr commented Nov 24, 2020

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.15.5 darwin/amd64
  • Run gopls -v version to get version of Gopls if you are using the language server.
Build info
----------
golang.org/x/tools/gopls v0.5.3
    golang.org/x/tools/gopls@v0.5.3 h1:C8QSrqjqaVzlVoHL1R9yWbROoOApRgI8gN1G+cHlPuw=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
    golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
    golang.org/x/tools@v0.0.0-20201110032815-ae45d7cf37a9 h1:S0ATUNSw92bO7f5Z+1tSQsq48TdQs2Ye2rTGJdtf5qc=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
    mvdan.cc/gofumpt@v0.0.0-20200927160801-5bfeb2e70dd6 h1:z+/YqapuV7VZPvBb3GYmuEJbA88M3PFUxaHilHYVCpQ=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
1.51.1
e5a624b788d92b8d34d1392e4c4d9789406efe8f
x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.18.1
  • Run go env to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nuruddin.ashr/Library/Caches/go-build"
GOENV="/Users/nuruddin.ashr/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/nuruddin.ashr/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/nuruddin.ashr/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/yc/cb3vzbts51jd4_r408dnm8kc0000gr/T/go-build486617498=/tmp/go-build -gno-record-gcc-switches -fno-common"

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

{
  "go.formatTool": "goimports",
  "go.useLanguageServer": true,
  "go.lintTool": "golangci-lint",
  "go.testTags": "integration",
  "gopls.env": {
    "GOFLAGS": "-tags=integration"
  }
}

Describe the bug

Given this test file

package foo_test

import "testing"

func TestFoo(t *testing.T) {
	t.Error("Oops")

	t.Run("Nested", func(t *testing.T) {
		t.Error("oops")
	})
}

The output would be

Running tool: /usr/local/bin/go test -timeout 30s -coverprofile=/var/folders/yc/cb3vzbts51jd4_r408dnm8kc0000gr/T/vscode-goWInLIX/go-code-cover -tags integration github.com/uudashr/foo

--- FAIL: TestFoo (0.00s)
    /Users/me/Projects/foo/foo_test.go:6: Oops
    --- FAIL: TestFoo/Nested (0.00s)
        foo_test.go:9: oops
FAIL
coverage: [no statements]
FAIL	github.com/uudashr/foo	0.021s
FAIL

The output of foo_test.go:9 is not expanded, so it's not clickable. While the foo_test.go:6 properly expanded.

Expect to also expand the foo_test.go:9, would be something like:

--- FAIL: TestFoo (0.00s)
    /Users/me/Projects/foo/foo_test.go:6: Oops
    --- FAIL: TestFoo/Nested (0.00s)
        /Users/me/Projects/foo/foo_test.go:9: oops
FAIL
coverage: [no statements]
FAIL	github.com/uudashr/foo	0.021s
FAIL

Steps to reproduce the behavior:

  1. Use the source code provided above
  2. Run the test Go: Test Package
  3. You can see the foo_test.go:9 is not expanded
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/273048 mentions this issue: src/testUtils: adjust file path expansion regexp to capture subtest failures

@hyangah hyangah added this to the v0.19.1 milestone Dec 8, 2020
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/276212 mentions this issue: [release] src/testUtils: adjust file path expansion regexp to capture subtest failures

gopherbot pushed a commit that referenced this issue Dec 8, 2020
… subtest failures

Looks like verbose mode handling (json mode) already handles subtest error
messages as expected.

Fixes #956

Change-Id: I086076f1ab5435bd51f0956ec74e62d59e323531
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/273048
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
(cherry picked from commit 8ea68d8)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/276212
@golang golang locked and limited conversation to collaborators Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants