-
Notifications
You must be signed in to change notification settings - Fork 728
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.testFlags doesn't pass items before -args to debug binaries #1636
Comments
I agree that this is confusing, though I'm not sure we can change the behavior at this point. We will discuss this in our triage meeting. For reference, would you find a separate configuration option for test arguments to be equally confusing? |
From my perspective, there's "flags for building the test binary", and "flags for running the test binary". I would like to be able to configure the latter once, and have them apply equally whether I'm running or debugging that binary. If having Also, poking around, I'm seeing some extra fun behavior where Which makes me think that making the use case of "I want vscode-go to always run my tests with verbose enabled" work without arcane invocations may simply require a special case no matter what (absent any changes to
|
We discussed this today, and consensus was that we can't change this behavior at this point: we can't break users who have configurations containing -args.
I'm not seeing this behavior. I see |
Hmm ... yeah, I think that was an artifact of caching, or more likely typos. Doing a more careful, isolated test (below), I'm finding that no variation on So it seems that, to reliably get verbose test output with the extension, the only way to do it right now is to double-request it by using I guess the question is, should the extension replicate how To me, having the extension act like More fiddly bits: Setup I'm working with:
package example
import "testing"
func TestDemo(t *testing.T) {
t.Log("verbose output")
}
I think the difference here is, subtly, captured by the
Confusing, but documented 🤷♂️ |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Go from the VS Code integrated terminal.go version go1.16.6 linux/amd64
gopls -v version
to get version of Gopls from the VS Code integrated terminal.golang.org/x/tools/gopls v0.7.0
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.1.58.2 c3f126316369cd610563c75b1b1725e0679adfb3 x64
0.26.0
Go: Locate Configured Go Tools
command.Checking configured tools....
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.Describe the bug
This is basically a re-hash / follow-up to old issue microsoft/vscode-go#2115
If you set
go.testFlags
to["-v"]
, then you get verbose test output when running tests but not debugging them. If you set it to["-args","-test.v"]
then you get verbose output when debugging but not when running. You have to combine the two via["-v", "-args", "-test.v"]
to get both behaviors.This is quite confusing. It seems that
testFlags
elements before-args
ought to be passed to the debug binary with thetest.
prefix added, the same waygo test
does when non-debug running tests.Steps to reproduce the behavior:
go.testFlags
to["-v"]
ps auxww | grep test
or such to see the running processes, observe that the test is run as/path/to/something.test -run ^TestName$
, instead of as/path/to/something.test -run ^TestName$ -test.v
The text was updated successfully, but these errors were encountered: