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:
Raghvender 2023-12-11 15:41:45 -06:00 committed by Gopher Robot
parent cc38c68ae0
commit e076c1b897
3 changed files with 11 additions and 3 deletions

View file

@ -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

View file

@ -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.

View file

@ -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.