mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
cmd/go: allow test caching for the -fullpath flag
Change-Id: I5662b8ff617772ca2afec8bf419c468a3e69c392 Reviewed-on: https://go-review.googlesource.com/c/go/+/548996 Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
cc38c68ae0
commit
e076c1b897
3 changed files with 11 additions and 3 deletions
|
@ -1802,7 +1802,7 @@
|
|||
// The rule for a match in the cache is that the run involves the same
|
||||
// test binary and the flags on the command line come entirely from a
|
||||
// restricted set of 'cacheable' test flags, defined as -benchtime, -cpu,
|
||||
// -list, -parallel, -run, -short, -timeout, -failfast, and -v.
|
||||
// -list, -parallel, -run, -short, -timeout, -failfast, -fullpath and -v.
|
||||
// If a run of go test has any test or non-test flags outside this set,
|
||||
// the result is not cached. To disable test caching, use any test flag
|
||||
// or argument other than the cacheable flags. The idiomatic way to disable
|
||||
|
|
|
@ -126,7 +126,7 @@ elapsed time in the summary line.
|
|||
The rule for a match in the cache is that the run involves the same
|
||||
test binary and the flags on the command line come entirely from a
|
||||
restricted set of 'cacheable' test flags, defined as -benchtime, -cpu,
|
||||
-list, -parallel, -run, -short, -timeout, -failfast, and -v.
|
||||
-list, -parallel, -run, -short, -timeout, -failfast, -fullpath and -v.
|
||||
If a run of go test has any test or non-test flags outside this set,
|
||||
the result is not cached. To disable test caching, use any test flag
|
||||
or argument other than the cacheable flags. The idiomatic way to disable
|
||||
|
@ -1717,7 +1717,8 @@ func (c *runCache) tryCacheWithID(b *work.Builder, a *work.Action, id string) bo
|
|||
"-test.short",
|
||||
"-test.timeout",
|
||||
"-test.failfast",
|
||||
"-test.v":
|
||||
"-test.v",
|
||||
"-test.fullpath":
|
||||
// These are cacheable.
|
||||
// Note that this list is documented above,
|
||||
// so if you add to this list, update the docs too.
|
||||
|
|
|
@ -114,6 +114,13 @@ go test testcache -run=TestOSArgs -failfast
|
|||
go test testcache -run=TestOSArgs -failfast
|
||||
stdout '\(cached\)'
|
||||
|
||||
# golang.org/issue/64638: that includes the `-fullpath` argument.
|
||||
go test testcache -run=TestOSArgs -fullpath
|
||||
! stdout '\(cached\)'
|
||||
go test testcache -run=TestOSArgs -fullpath
|
||||
stdout '\(cached\)'
|
||||
|
||||
|
||||
# Executables within GOROOT and GOPATH should affect caching,
|
||||
# even if the test does not stat them explicitly.
|
||||
|
||||
|
|
Loading…
Reference in a new issue