Files
moby/hack/test
Sebastiaan van Stijn 35acf347eb hack: disable go telemetry in integration tests
commit 081987b647 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 <github@gone.nl>
2025-10-21 12:17:30 +02:00
..
2025-08-16 09:12:56 +02:00