-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
codelens: don't treat TestMain as a test #482
Comments
Needs adjustment in the filters in getTestFunctions, etc. -- |
I looked into this issue a bit (thanks @zmb3 for the easy repro) and just wanted to update this with some things I found and thoughts on a fix: So it looks like 'TestMain' is actually run successfully using Since it is actually possible to run this test using
|
I agree that it's possible to run the If someone wants to debug the setup or teardown code, they can still put breakpoints in |
since Looking at the |
I will close this issue in favor of #654. |
…estMain(*testing.M) <img width="673" alt="image" src="https://user-images.githubusercontent.com/51177946/160227163-0c38a63d-32a5-43cc-883f-39730df5d421.png"> <img width="674" alt="image" src="https://user-images.githubusercontent.com/51177946/160227174-0ed987ff-f587-4085-b47a-2b13d86e3dbe.png"> <img width="672" alt="image" src="https://user-images.githubusercontent.com/51177946/160227189-59d572fe-8847-4d62-b1ce-b0355fe4fca7.png"> <img width="670" alt="image" src="https://user-images.githubusercontent.com/51177946/160227203-3a8bcc4d-bf0d-486b-8ec1-68821ecdeb36.png"> <img width="871" alt="image" src="https://user-images.githubusercontent.com/51177946/160894934-f772660d-f100-495f-95c0-6d0f88ea0005.png"> <img width="874" alt="image" src="https://user-images.githubusercontent.com/51177946/160895017-c5493dab-99f3-4567-a8f4-b822d2616ad4.png"> Fixes #482 Fixes #2039 Change-Id: I9b69d762b8a968f94931455d771c03ff6e73182e GitHub-Last-Rev: 650fb12 GitHub-Pull-Request: #2129 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/394136 Reviewed-by: Polina Sokolova <polina@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org> Run-TryBot: Polina Sokolova <polina@google.com>
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code InsidersDescribe the bug
The feature that puts clickable "run test | debug test" on top of test functions identifies
TestMain
as a runnable test.TestMain
is not something that works withgo test -run ...
, so clicking the "run test" button results in the following slightly confusing message.Would it be more clear if we simply didn't offer the run/debug button for TestMain?
Steps to reproduce the behavior:
TestMain
The text was updated successfully, but these errors were encountered: