Explorar el Código

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>
Joe Tsai hace 6 años
padre
commit
6a2180f84e
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 0
      .gitignore
  2. 2 2
      integration_test.go

+ 1 - 0
.gitignore

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

+ 2 - 2
integration_test.go

@@ -250,8 +250,8 @@ func mustInitDeps(t *testing.T) {
 	// Explicitly clear GOROOT, so each toolchain uses their default GOROOT.
 	// Explicitly clear GOROOT, so each toolchain uses their default GOROOT.
 	check(os.Unsetenv("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).
 	// Setup GOPATH for pre-module support (i.e., go1.10 and earlier).
 	goPath = filepath.Join(testDir, "gopath")
 	goPath = filepath.Join(testDir, "gopath")