8000 cmd/go: should we reuse GOMODCACHE in TestScript? · Issue #42017 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
cmd/go: should we reuse GOMODCACHE in TestScript? #42017
Closed
@mvdan

Description

@mvdan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0