-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: cannot test multiple sub-benchmarks #47800
Comments
Change https://golang.org/cl/343433 mentions this issue: |
Here's a workaround:
I think this is working as intended though. Running
Note that the regexp is split by "/", hence why it doesn't work. I admit this is somewhat hidden, though. Closing for now, we should probably have another issue about surfacing this better, somehow, if it doesn't exist yet. |
@mknyszek closed on purpose or accident? |
On purpose. See the end of my last message. |
Ah , should be dup of #39904 |
@mknyszek I’m working on vscode-go, so I need an automated way of doing this. What I really need is a flag that lets me specify a list of tests and sub tests. The regex syntax is problematic for this case. |
@seankhliao Thanks for finding that! @firelizzard18 Looking at it briefly, it appears that #39904 is close to what you want (maybe even exactly), and it looks like that proposal was accepted a year ago. AFAICT it just needs someone to implement it. |
Changes the logic for creating sub-tests on the fly. Prevously, test IDs were created in such a way that it was impractical to support running subtests. This changes the way IDs are created for subtests such that running subtests is simple. Additionally, this CL updates 'goTest' to run `go test -run=^$ -bench ^BenchmarkFoo/Bar$` (without the parentheses) when a single benchmark is selected, as a hack to get around golang/go#47800. Updates #1641 Change-Id: I26eac8a5a396df3923073274ed93d9c59107d9c3 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/343433 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Go executes the sub-benchmarks that match the pattern.
What did you see instead?
Go runs nothing:
The text was updated successfully, but these errors were encountered: