-
Notifications
You must be signed in to change notification settings - Fork 797
Test Explorer: test logging in another package results in wrong file path in Test Output #2444
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
Comments
Still present in 2024, VSCode Go v0.41.2 |
This should be addressed by #3523 (with |
@MadTyres Would you try Go Companion's explorer and see if it resolves this issue for you? |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Yeah, the test explorer in Go Companion displays the correct file path :) |
Yes, the plan is to entirely replace vscode-go's test handling (both legacy and text explorer) with Go Companion's implementation, but we haven't established when that will happen. We want to collect more feedback and iterating on the implementation is faster when it's in a separate extension. I'm going to reopen this issue since this is still broken in the base extension. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
Run
go version
to get version of Go from the VS Code integrated terminal.Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Check your installed extensions to get the version of the VS Code Go extension
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.go: /Users/mathiastg/go/bin/go: go version go1.19.1 darwin/arm64
gotests: /Users/mathiastg/go/bin/gotests (version: v1.6.0 built with go: go1.19.1)
gomodifytags: /Users/mathiastg/go/bin/gomodifytags (version: v1.16.0 built with go: go1.19.1)
impl: /Users/mathiastg/go/bin/impl (version: v1.1.0 built with go: go1.19.1)
goplay: /Users/mathiastg/go/bin/goplay (version: v1.0.0 built with go: go1.19.1)
dlv: /Users/mathiastg/go/bin/dlv (version: v1.9.1 built with go: go1.19.1)
staticcheck: /Users/mathiastg/go/bin/staticcheck (version: v0.3.3 built with go: go1.19.1)
gopls: /Users/mathiastg/go/bin/gopls (version: v0.9.4 built with go: go1.19.1)
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"]
orgopls
prefixes."go.toolsManagement.autoUpdate": true
"go.testEnvFile": "${workspaceFolder}/local.env"
Describe the bug
Consider the file tree below
I have a test in
a_test.go
, that uses a helper function in helper_package.helper.go. This helper function logs some errors on t.Error.I run the test in a_test.go using the Test Explorer.
VS Code tries to automatically GOTO the line in helper.go where I log something, but the file path is wrong.
VS Code redirects me to
src/tests/helper.go
, which doesn't exist, so it shows a prompt like the attached picture.helper.go is placed in
src/tests/helper_packages/helper.go
.I expected VS Code to redirect me to
src/tests/helper_package/helper.go
Steps to reproduce the behavior:
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
The text was updated successfully, but these errors were encountered: