Closed
Description
When a txt script file is run as a subtest, we share the host's GOCACHE by default, presumably to allow reusing the build cache and speeding up go build
commands inside each test:
"GOCACHE=" + testGOCACHE,
You can verify this easily:
> exec env
[stdout]
[...]
GOCACHE=/home/mvdan/.cache/go-build
Should we do the same with the new GOMODCACHE Go environment variable? That would let the tests share the host's module download cache.
The upside is that, for most tests, we would download and copy fewer files, even if it's just the ones in testdata/mod/
.
A potential downside is that if a test relies on actual downloads happening, they'd have to unset GOMODCACHE to use an empty module download cache.
Is this worth it? Opening an issue for discussion. /cc @bcmills @jayconrod @matloob