Skip to content
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: "help test" caching paragraph is out-of-date and potentially misleading #48484

Open
jwebb opened this issue Sep 20, 2021 · 1 comment
Open

Comments

@jwebb
Copy link

@jwebb jwebb commented Sep 20, 2021

First the out-of-date part: In c55a50e the special-casing of -timeout was removed, but the documentation for this behaviour at https://github.com/golang/go/blob/master/src/cmd/go/internal/test/test.go#L131 is still there.

Now the misleading: To correctly interpret "the run involves the same test binary and the flags on the command line", one has to understand some amount of the inner workings of the test process - specifically that we are talking about only those flags that are actually forwarded to the binary under test, and not all flags passed to go test itself. So for example -vet is fine to use for a cacheable run. Further, AFAIK the flags that are/aren't forwarded aren't enumerated in any documentation, or even in a single place in the code - there's a little discussion at go help testflag but no list.

I think the clearest way to resolve this would be to remove the flag-level detail in that paragraph, and instead explictly state the caching behaviour of each flag in go help testflag, i.e. "Cacheable" / "Ignored for caching" / "Prevents caching".

@dr2chase
Copy link
Contributor

@dr2chase dr2chase commented Sep 20, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants