-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Milestone
Description
Proposal Details
I propose that cmd/go have a new go test flag to control whether the linked test binary is written to the GOCACHE build cache.
Tiny example change: https://go-review.googlesource.com/c/go/+/739161
That change lets this,
$ go test -cachelink -run=^TestFoo$ ./pkg/
$ go test -cachelink -run=^TestBar$ ./pkg/
.... not have to link pkg.test on the second call.
From the docs there:
-cachelink
Cache the emphemeral test binary (the linker output) in the build
cache. This avoids re-linking the test binary if running the same
test binary repeatedly but with different flags, environment,
or other test inputs such that the test caching rules above
would not apply. On such case is Go test wrappers that shard tests
within a package across multiple machines, sharing a common build
cache with GOCACHEPROG.
I'm not wed to those exact docs, but that explains the background.
(I thought I remembered seeing this proposal once, but I can't find it, so maybe I'm remembering a conversation instead?)
/cc @golang/tools-team
mwriter
Metadata
Metadata
Assignees
Labels
ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.