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: -run= not working with fuzz subtest names #48149
Comments
@rsc Can you clarify what you mean here? I don't see the bug. Are you just noting that it says 'testdata/corpus' (now 'testdata/fuzz') in the fail line? That's because it corresponds to the corpus file written in 'testdata/corpus' |
Ah I think I understand what @rsc is saying now. Correct me if I'm wrong, but it sounds like the confusion is because the test is runnable with Will work on these. |
Bug 3 is going to be a bit difficult to fix, but not impossible. The trickiest bit is that we have to load the corpus in order to know which seed corpus entries (if any) that the
When in reality it should look like this:
One possible solution is to load all of the seed corpus in Will keep looking into it. |
This actually might not be as complicated as I thought. If we treat this the same way that we treat subtests with t.Run, then it's fine to print the |
Change https://golang.org/cl/354632 mentions this issue: |
This change fixes some issues with -run, and the subsequent command line output when running in verbose mode. It replaces CorpusEntry.Name with CorpusEntry.Path, and refactors the code accordingly. This change also adds a lot of additional tests which check explicit command line output when fuzz targets are run without fuzzing. This will be important to avoid regressions. Updates #48149 Change-Id: If34b1f51db646317b7b51c3c38ae53231d01f568 Reviewed-on: https://go-review.googlesource.com/c/go/+/354632 Trust: Katie Hockman <katie@golang.org> Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
I'm not actually sure how to fix Bug 1t. The goal of that is to only print the package name in the |
For 1t (the t appears to be for typo), I would suggest just dropping the pkg path unconditionally. The common case is testing a single package. People are smart enough to understand they need to add it back if they were running test on multiple packages. |
Change https://golang.org/cl/362116 mentions this issue: |
Bug 1t: The re-run command should not include the package name if I didn't include the package name. That is, if I ran
go test
and notgo test <args>
, then it should saygo test -run...
notgo test <pkgname> -run...
. It's jarring to see the package name appear when I wasn't using it explicitly.Bug 2: The -run= argument does not match the test failure:
Note that the failure has an extra 'testdata/corpus' in its name. I assume that was meant to be left out of the name printed by the test.
Bug 3: The -run argument does not work to select subtests of fuzz targets:
Saying
Fuzz/somethingelse
should have matchedsomethingelse
againsttestdata
and not matched. Or the implication of the suggested command is that it should have matchedsomethingelse
againstc1c09817115370fcbcf4ea60d47a71bdd843fbe249bb987f98a9421b1543de83
and still not matched. Either way, the test should not have run, but it did./cc @golang/fuzzing
The text was updated successfully, but these errors were encountered: