-
Notifications
You must be signed in to change notification settings - Fork 752
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
codelens: a way to use selected launch.json configuration in run test | debug test #855
Comments
Thanks @polinasok for putting up all the details.
|
What do you mean by "not really compatible"? |
@polinasok The launch configuration has the following -
This is not suitable for general 'debug test' codelens launch configuration - the main purpose of debug test codelen is to automatically determine the Users may have multiple launch configurations in the I sent multiple users to the |
I see what you mean. I included Interestingly, adding If we do support this feature, it is up to us how to combine the two sources of Whatever we do, we just need to make sure it is documented and also flagged via some kind of warnings/logging, so if the behavior is unexpected, the user can get an explanation without having to search forums or file issues. |
Related issue: #128 The many ways to specify build/test flags/tags that sometimes override each other and sometimes are ignored is causing issues in all directions. In the short-term, whatever the behavior is we need to be very careful about documenting it (#860). In the long-term, we have the option of revisiting this alltogether with dlv-dap. New adapter, new flags. Should we? If according to microsoft/vscode-go#3185 (comment), the options in |
One disadvantage of |
Change https://golang.org/cl/366915 mentions this issue: |
They are all fixed in the latest dlv version. Updates #1676 Updates #123 Updates #855 Updates #1840 Change-Id: I6014a1382396865a1921eb6c92e1ccccdea556de Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/366915 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Polina Sokolova <polina@google.com>
codelens also doesn't support the new 'asRoot' launch option that allows debugging and testing launch configurations to run as root. |
also finding this limitation frustrating, I need to pass |
Why are you passing args to a test binary? That sounds like something that would be better done with a main func/package. |
Users complain that the handy
run test | debug test
links above their test functions ignore the flags they set in their launch configuration (example, example, example). They can fallback onsettings.json
usinggo.testFlags
,go.delveConfig
, etc, but that is not obvious or intuitive and has surprised users with additional limitations fordebug test
vsrun test
(e.g. #1636, microsoft/vscode-go#2894 (comment), microsoft/vscode-go#2115 (comment)).According to @ramya-rao-a, a while back there was no way to feed current selected launch configuration into the codelens, so another set of dlv-related settings was supported as an alternative. Since then a new mechanism to support this could have been introduced, so we should investigate what is possible now.
Below is a quick way to reproduce the current behavior:
Test function:
Selected launch configuration
Debug with
▷ Start Debugging
orRun > Start Debugging (F5)
Uses
launch.json
configuration, so the test passes.Debug with
debug test
Doesn't use
launch.json
configuration, so the test fails.Run with
Run > Run Without Debugging (^F5)
Uses
launch.json
configuration, so the test passes. (Note that this actually goes through the debug adapter, which launches dlv - see #336)Run with
run test
Doesn't use
launch.json
configuration, so the test fails. (Note that this usesgo test
and bypasses dlv - see #336)Adding flags to
settings.json
run test
now passes, butdebug test
behavior is unchanged.run test
passes, but only prints "ok", no details.debug test
works as expected.Combining these makes both work as expected - pass and print verbose details.
The text was updated successfully, but these errors were encountered: