diff options
author | Michael Matloob <matloob@golang.org> | 2024-03-13 13:27:03 -0400 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2024-03-14 21:07:20 +0000 |
commit | d45e8bf403e0296297d4028a75ad61cb309cd12c (patch) | |
tree | 6e85719607e1901936564b55e684e4da8a7b2ace /src/cmd/go/script_test.go | |
parent | 1d96895ccbea79daa9d6538bf9da6a4dd197336b (diff) | |
download | go-d45e8bf403e0296297d4028a75ad61cb309cd12c.tar.gz go-d45e8bf403e0296297d4028a75ad61cb309cd12c.zip |
cmd/internal/telemetry: add a shim package around telemetry
The purpose of this package is to have a build tagged variant so that
when we're building the bootstrap go command it does not depend on the
net package. (net is a dependency of golang.org/x/telemetry/counter on
Windows).
The TESTGO_TELEMETRY_DIR environment variable used by the go tests to
change the telemetry directory is renamed to TEST_TELEMETRY_DIR to
make it more general to other commands that might want to set it for
the purpose of tests. The test telemetry directory is now set using
telemetry.Start instead of countertest.Open. This also means that the
logic that decides whether to upload counter files is now going to run
from the cmd/go tests (but that's okay because it's aleady been
running when cmd/go has been invoked outside of its tests.
Change-Id: Ic4272e5083facde010482d8b8fc3c95c03564bc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/571096
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Diffstat (limited to 'src/cmd/go/script_test.go')
-rw-r--r-- | src/cmd/go/script_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index d36de720cd..0c494c0514 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -195,7 +195,7 @@ func initScriptDirs(t testing.TB, s *script.State) (telemetryDir string) { telemetryDir = filepath.Join(work, "telemetry") must(os.MkdirAll(telemetryDir, 0777)) - must(s.Setenv("TESTGO_TELEMETRY_DIR", filepath.Join(work, "telemetry"))) + must(s.Setenv("TEST_TELEMETRY_DIR", filepath.Join(work, "telemetry"))) must(os.MkdirAll(filepath.Join(work, "tmp"), 0777)) must(s.Setenv(tempEnvName(), filepath.Join(work, "tmp"))) |