From 6a2180f84e122e8957fe5f87bd8c8bbd3271efa2 Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Thu, 11 Jul 2019 16:34:17 -0700 Subject: [PATCH] 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 --- .gitignore | 1 + integration_test.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bc8f9617..b0998829 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .cache +.gocache vendor cmd/protoc-gen-go/protoc-gen-go cmd/protoc-gen-go/testdata/go.sum diff --git a/integration_test.go b/integration_test.go index f483c91d..bc3944d4 100644 --- a/integration_test.go +++ b/integration_test.go @@ -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")