Skip to content

Disable product telemetry in E2E tests - #22686

Open
Mitch Denny (mitchdenny) wants to merge 2 commits into
mainfrom
mitchdenny-disable-e2e-product-telemetry
Open

Mitch Denny (mitchdenny) wants to merge 2 commits into
mainfrom
mitchdenny-disable-e2e-product-telemetry

Conversation

@mitchdenny

@mitchdenny Mitch Denny (mitchdenny) commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: b063ec9f2d685a46dcd4e302fd06be62349e9957

Dimension Assessment Rationale
Change confidence 8/10 ↑ CLI and deployment host inheritance tests pass; a real prebuilt Docker terminal confirms container opt-outs.
↑ 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.
Diagnosis confidence 9/10 ↑ CLI and dashboard read separate product opt-out variables; .NET CLI telemetry opt-out does not disable Aspire telemetry.
↑ Workflow install/setup commands execute before the test assembly loads, so the module initializer alone was insufficient.
Evidence fit 7/10 ↑ The review identified early deployment CLI invocations and the unnecessary dedicated matrix shard; both are now addressed.
↓ 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.
  • Test-selection impact was checked with SelectTests: CLI E2E and Infrastructure.Tests are selected; deployment E2E remains schedule/dispatch-only advisory.
  • 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).
  • Azure deployment E2E and Podman execution were not run.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22686

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22686"

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues: 1 telemetry opt-out gap in deployment CI setup and 1 unnecessary Azure deployment job.

Comment thread tests/Shared/E2ETelemetryEnvironment.cs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

2 / 101 PR test projects · 0 PR jobs, from 11 changed files.

Selected PR test projects (2 / 101)

Aspire.Cli.EndToEnd.Tests, Infrastructure.Tests

Selected PR jobs (0)

none


How these were chosen — grouped by what changed

📄 .github/workflows/deployment-tests.yml (changed)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/E2ETelemetryTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliInstallStrategyTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

Job reasons

none


Selection computed for commit b063ec9.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the E2E product telemetry opt-out changes.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants