From 35acf347eb7655f91b24314bd80bbc8bfffeffa3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 21 Oct 2025 12:17:30 +0200 Subject: [PATCH] hack: disable go telemetry in integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 081987b647b724b628f68bc68084341b3990d804 updated the Dockerfile to disable go's telemetry in our dev / test-environment; as collecting this data doesn't serve much purpose. However, the configuration to disable telemetry is tied to the user's home-directory (HOME); and disabling telemetry writs a config-file to the user's home-directory (`~/.config/go/telemetry/mode`). While go provides env-vars about the mode and location (`GOTELEMETRY` and `GOTELEMETRYDIR`), those env-vars are read-only and cannot be used to either disable telemetry or to set the location; > Information about telemetry configuration is also available via read-only Go environment variables: > > go env GOTELEMETRY reports the telemetry mode. > go env GOTELEMETRYDIR reports the directory holding telemetry configuration and data. Some steps in our CI set up a different home-directory, which is not configured to disable telemetry, which means that CI currently leaves behind a bunch of files related to this; make TEST_FILTER=TestPruneDontDeleteUsedDangling test-integration tree -a bundles/test-integration/fake-HOME/ bundles/test-integration/fake-HOME/ └── .config └── go └── telemetry ├── local │ ├── asm@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count │ ├── compile@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count │ ├── go@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count │ ├── link@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count │ ├── test2json@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count │ ├── upload.token │ └── weekends └── upload 6 directories, 7 files This patch disables go telemetry also for this home-directory to prevent those files from being created, and to prevent go from producing the telemetry. With this patch, only the file to disable telemetry is produced: make TEST_FILTER=TestPruneDontDeleteUsedDangling test-integration tree -a bundles/test-integration/fake-HOME/ bundles/test-integration/fake-HOME/ └── .config └── go └── telemetry └── mode 4 directories, 1 file Signed-off-by: Sebastiaan van Stijn --- hack/make/.integration-test-helpers | 7 +++++++ hack/test/e2e-run.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/hack/make/.integration-test-helpers b/hack/make/.integration-test-helpers index 380fea1506..4dd069c7df 100644 --- a/hack/make/.integration-test-helpers +++ b/hack/make/.integration-test-helpers @@ -188,6 +188,13 @@ test_env() { ( set -e [ -n "$TESTDEBUG" ] && set -x + + # Disable collecting local telemetry, as collected by Go and Delve; + # + # - https://github.com/go-delve/delve/blob/v1.24.1/CHANGELOG.md#1231-2024-09-23 + # - https://go.dev/doc/telemetry#background + HOME="$ABS_DEST/fake-HOME" go telemetry off + env -i \ DEST="$ABS_DEST" \ DOCKER_API_VERSION="$DOCKER_API_VERSION" \ diff --git a/hack/test/e2e-run.sh b/hack/test/e2e-run.sh index ec0a9c13c9..be90dded3d 100755 --- a/hack/test/e2e-run.sh +++ b/hack/test/e2e-run.sh @@ -40,6 +40,13 @@ test_env() { ( set -e +u [ -n "$TESTDEBUG" ] && set -x + + # Disable collecting local telemetry, as collected by Go and Delve; + # + # - https://github.com/go-delve/delve/blob/v1.24.1/CHANGELOG.md#1231-2024-09-23 + # - https://go.dev/doc/telemetry#background + HOME="$ABS_DEST/fake-HOME" go telemetry off + env -i \ DOCKER_API_VERSION="$DOCKER_API_VERSION" \ DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \