Repository navigation
Disable product telemetry in E2E tests - #22686
Mitch Denny (mitchdenny) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22686Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22686" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the E2E telemetry opt-out changes.
No open issues 🎉
What changed in this PR
This PR prevents Aspire CLI and locally launched dashboard product telemetry from E2E tests from skewing usage data, while preserving application OTLP telemetry and CLI profiling. Dashboards deployed to Azure remain outside this change’s scope.
Changes:
- Set telemetry opt-outs when CLI and deployment test hosts initialize, allowing child-process overrides.
- Apply opt-outs explicitly to Docker containers, including prebuilt images, the Podman helper, and shell setup.
- Add regression coverage and document the opt-out scope.
| File | Description |
|---|---|
| tests/Shared/Hex1bTestHelpers.cs | Adds opt-outs to PowerShell and Unix bundle setup. |
| tests/Shared/E2ETelemetryEnvironmentTests.cs | Tests process inheritance, overrides, and shell defaults. |
| tests/Shared/E2ETelemetryEnvironment.cs | Initializes test-host telemetry opt-outs. |
| tests/Shared/CliInstallStrategy.cs | Adds opt-outs to shared shell assignments. |
| tests/Aspire.Deployment.EndToEnd.Tests/README.md | Documents local opt-outs and the Azure exclusion. |
| tests/Aspire.Deployment.EndToEnd.Tests/E2ETelemetryTests.cs | Runs shared checks in deployment tests. |
| tests/Aspire.Deployment.EndToEnd.Tests/Aspire.Deployment.EndToEnd.Tests.csproj | Includes shared telemetry initialization and checks. |
| tests/Aspire.Cli.EndToEnd.Tests/README.md | Documents opt-outs, profiling, and process overrides. |
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliInstallStrategyTests.cs | Tests container opt-outs with prebuilt-image coverage. |
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs | Applies container opt-outs and reuses setup for Podman. |
| tests/Aspire.Cli.EndToEnd.Tests/E2ETelemetryTests.cs | Adds shared checks and a Docker terminal test. |
| tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj | Includes shared telemetry initialization and checks. |
Review effort: Balanced
James Newton-King (JamesNK)
left a comment
There was a problem hiding this comment.
Found 2 issues: 1 telemetry opt-out gap in deployment CI setup and 1 unnecessary Azure deployment job.
Co-authored-by: Copilot App <[email protected]>
Tests selector2 / 101 PR test projects · 0 PR jobs, from 11 changed files. Selected PR test projects (2 / 101)
Selected PR jobs (0)none How these were chosen — grouped by what changed📄 🧪 🧪 🧪 🧪 Job reasonsnone Selection computed for commit |
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
b063ec9f2d685a46dcd4e302fd06be62349e9957↑ Deployment CI sets the CLI opt-out before install/setup commands.
↓ Full profiling E2E was blocked by npm connectivity; Azure deployment jobs were not run.
↑ Workflow install/setup commands execute before the test assembly loads, so the module initializer alone was insufficient.
↓ Telemetry ingestion records were not inspected to quantify the reported skew.
Description
Prevent CLI and locally launched dashboard product telemetry from E2E tests skewing usage data. Both E2E test hosts opt out before launching child processes, and CLI test containers explicitly receive the opt-outs, including prebuilt images and the Podman helper. The deployment workflow also opts out before installing and setting up the CLI. Deployment-host inheritance coverage now runs in the existing authentication shard rather than creating a separate deployment matrix job; shell-setup coverage remains in CLI E2E. Application OTLP and CLI profiling remain independent.
This does not configure dashboards deployed to Azure. Those require a separate follow-up.
Validation
./restore.sh— passed.ASPIRE_E2E_DOTNET_IMAGE=mcr.microsoft.com/azurelinux/base/core:3.0 MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method '*.ChildProcessesInheritOptOutAndCanOverrideIt' --filter-method '*.ShellEnvironmentSetupOptsOutOfProductTelemetry' --filter-method '*.DockerTerminalStartsWithProductTelemetryOptedOut' --filter-method '*.ConfigureDockerContainerStrategy_OptsOutOfProductTelemetry' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed (6 tests).MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Deployment.EndToEnd.Tests/Aspire.Deployment.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method '*.ProductTelemetryOptOutIsInheritedByChildProcesses' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed (1 test).MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-class '*.CliInstallStrategyTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed (74 tests).MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-method '*.OtlpExporter_WithProfiling_EnablesProfilingProviderWhenTelemetryOptedOut' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed.ruby -e 'require "yaml"; YAML.load_file(".github/workflows/deployment-tests.yml"); puts "workflow YAML parsed"'— passed.ASPIRE_E2E_QUALITY=release MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method '*.OtlpExportedSpansContainEnrichmentTags' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— blocked before the test ran: Docker image build failed downloading pnpm from npm (ECONNRESET).Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?