]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: allow test caching for the -fullpath flag
authorRaghvender <raghvenders@gmail.com>
Mon, 11 Dec 2023 21:41:45 +0000 (15:41 -0600)
committerGopher Robot <gobot@golang.org>
Mon, 29 Jan 2024 17:59:20 +0000 (17:59 +0000)
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>

src/cmd/go/alldocs.go
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/script/test_cache_inputs.txt

index 05e42a6d3111448d5ef9406ec8e0ba217644700f..a6166a7fdb034e58c3ac37891b5a1b7018ddc994 100644 (file)
 // 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
index 8a40547f2e3ad703898153561df66297910c75ba..b2b5d340278a288d0fb2a004b14effd26be6e773 100644 (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.
index 3705c700d10bc905f7cfdd63657a1ca7e3dbe1f0..1868da984203859a90bd6f89c3263c6970cbc022 100644 (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.