-
Notifications
You must be signed in to change notification settings - Fork 646
extension does not handle command-line args that need to be passed to tests #1534
Comments
So instead of
we should actually be running
If so, then we don't really need a new setting. We can look for PRs are always welcome. The place to make the change is https://github.com/Microsoft/vscode-go/blob/0.6.77/src/testUtils.ts#L127 |
Sounds good, I'll try to get this in ASAP! |
Hey... I do face the exact same issue when clicking on the "run test" link next to a function in the editor... I want to pass extra args for the test but those have to be appended to the values that are being passed as defaults... my go.testflags look like this: "go.testFlags": ["-args", "-logtostderr", "-stderrthreshold", "info", "-v", "4"], e.g. this is what happens now:
and it should be like this:
I think I could experiment with the code you pointed to above (testUtils.ts#L127) but I have absolutely no idea how I would even start to test those changes. |
@rschmied See Building and Debugging the extension to get the local set up and to debug the extension. Also, wait a few days till October starts to send your PR to win a t-shirt! For more details, see https://open.microsoft.com/2018/09/18/hacktoberfest-2018-microsoft/?WT.mc_id=hacktoberfest-twitter-beverst |
The fix for this issue is now out in the latest update to the Go extension (0.6.92). Thanks @rschmied! |
the
go test
supports passing command-line arguments to the test binary. To quotego test -help
:Sadly, the extension isn't aware of this rule, and adding any "-args" to the "go.testFlags" setting does not work, as the extension does not put such arguments last in the arguments list.
Steps to Reproduce:
Result:
The error is because "-args" is not placed after all other args to
go test
.I think the correct solution would be to define a new setting - perhaps "go.testArgs" - an array of arguments to the test binary.
I would love to work on this myself and submit a PR
The text was updated successfully, but these errors were encountered: