-
Notifications
You must be signed in to change notification settings - Fork 648
go.testFlags are not applied correctly when using the "debug test" code lens #2115
Comments
I believe this is because the The debug test codelens always had its limitations, especially when the test relied on arguments being passed to it. This is such a case and the workaround is to fallback to using a debug configuration in the launch.json file and pass |
😈
Em Ter, 13 de nov de 2018 03:02, Ramya Rao <notifications@github.com>
escreveu:
… I believe this is because the run test codelens runs the test as go test
-run ^TestFoo$ -ok whereas the debug codelens starts delve and passes -ok
as value for the --build-flags argument.
The debug test codelens always had its limitations, especially when the
test relied on arguments being passed to it. This is such a case and the
workaround is to fallback to using a debug configuration in the launch.json
file and pass -ok as part of the args property.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apf3hMxQtvOR8aNrm7vwjxd_KfEzxDWeks5uulJhgaJpZM4YYchb>
.
|
From
And in code go/src/cmd/go/internal/test/testflag.go#testFlags. I guess either us or |
I don't think there is a convenient way to get a "debug test under cursor" this way... You will have to constantly edit the |
@ramya-rao-a Could we add a new config value |
A lot of limitations of the |
#1534 tracked something similar for running tests. This makes use of the Instead of passing all the flags as Thoughts? |
@ramya-rao-a I tried the workaround you mentioned
But the |
@ramya-rao-a I am facing same problem. |
@sjwl, @apollocse Add |
Any updates for this? I am still having this issue (see referenced issue #2894 above ^) |
I have the same problem. |
The latest beta version of this extension respects the Can folks here please try it out and let us know how it goes? We will release an official update next week |
The latest version of this extension (0.12.0) has this feature now. Thanks @segevfiner for reporting and everyone else for pitching in :) Happy Coding! |
Steps to Reproduce:
foo_test.go
:.vscode/settings.json
:foo_test.go
and click the "run test" code lens, the test will pass.The text was updated successfully, but these errors were encountered: