integration_test.go: move Go cache

Move the Go cache from .cache/gocache to .gocache.
This moves it out of the .cache directory so that Travis-CI will
not cache the Go cache.

Unfortunately, the Go toolchain's caching algorithm is not
aggressive enough in evicting old entries, causing Travis-CI
to keep caching an ever growing Go cache.
We're at the point where network IO moving a massive Go cache
is more costly than not having it at all.

Change-Id: I3104efcdb8fa81a550900e8d06299e50296386f3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/185838
Reviewed-by: Herbie Ong <herbie@google.com>
This commit is contained in:
Joe Tsai 2019-07-11 16:34:17 -07:00 committed by Joe Tsai
parent 7492a09da9
commit 6a2180f84e
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.cache
.gocache
vendor
cmd/protoc-gen-go/protoc-gen-go
cmd/protoc-gen-go/testdata/go.sum

View File

@ -250,8 +250,8 @@ func mustInitDeps(t *testing.T) {
// Explicitly clear GOROOT, so each toolchain uses their default GOROOT.
check(os.Unsetenv("GOROOT"))
// Set a cache directory within the test directory.
check(os.Setenv("GOCACHE", filepath.Join(testDir, "gocache")))
// Set a cache directory outside the test directory.
check(os.Setenv("GOCACHE", filepath.Join(repoRoot, ".gocache")))
// Setup GOPATH for pre-module support (i.e., go1.10 and earlier).
goPath = filepath.Join(testDir, "gopath")