-
Notifications
You must be signed in to change notification settings - Fork 763
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
Cannot run nested tests over more than 2 levels #3022
Comments
This is a known issue. https://go-review.git.corp.google.com/c/vscode-go/+/451755/8..11/src/goRunTestCodelens.ts#b125
Unfortunately, this is getting harder to handle from the vscode that currently only relies on the document symbol info and regexp. |
golang/go#59445 is the issue discussing about moving test discovery to gopls. |
Change https://go.dev/cl/546260 mentions this issue: |
This change addresses two issues 1. When the subtest name includes regexp metacharacters, they need to be escaped before passing as `-run` flag value that assumes regexp. We split around '/' and then escape meta characters using escapeRegExp. 2. A bug in getOrCreateSubTest's child search prevented looking up a node for the nested subtest. We should've compared label with label. Added comments to clarify the difference between label and name. Fixes #3070 Fixes #2624 For #3022 (even though the issue is for the codelens) Change-Id: I250d1188e91679aee5704e1bccfcd2344cf1ae90 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/546260 Reviewed-by: Suzy Mueller <suzmue@golang.org> Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
I saw you made a fix for subtest handling, but is that related to this particular issue? I am using 0.40.1 I have similar setup to the issue creator. Here's a terminal command that works - hopefully it explains the nesting: However in VSC, I am unable to Run/Debug the "Without linked data" subtest. I can however run the "Valid form entry data" test. Thank you |
This should be addressed by #3523 |
I have confirmed that #3523 does not have this issue. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.f1b07bd25dfad64b0167beb15359ae573aecd2cc
x64
```
Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Describe the bug
When I write nested tests like this one:
I'm not able to run the "level 3" (
AlreadyAJwt
) test using the extension shortcut inside the code editor.The output prints an info saying
warning: no tests to run
:Note that the
go test
generated by the extension seams to be the problem, the arg-run
is not considering the "parent-child" testSwitchTokenToJwt
:-run ^\QTestTokenSwitcherServiceImpl\E$/^\QAlreadyAJwt\E$
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: