Skip to content

Re-apply xUnit v3 migration and OpenTelemetry telemetry overhaul#53827

Closed
Copilot wants to merge 8 commits intomainfrom
copilot/migration-to-xunit-v3-and-updates
Closed

Re-apply xUnit v3 migration and OpenTelemetry telemetry overhaul#53827
Copilot wants to merge 8 commits intomainfrom
copilot/migration-to-xunit-v3-and-updates

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

Combines two previously reverted changesets back onto main: the xUnit v2 → v3 test infrastructure migration and the Application Insights → OpenTelemetry telemetry overhaul.

xUnit v3 migration

  • Package refs updated: xunitxunit.v3.core, Microsoft.DotNet.XUnitExtensionsMicrosoft.DotNet.XUnitV3Extensions, Verify.XunitVerify.XunitV3, Microsoft.TemplateEngine.MocksMicrosoft.TemplateEngine.Mocks.XunitV3
  • xunit.console + custom Program.cs entry point removed; xUnit v3's built-in executable model used instead
  • Custom [Fact]/[Theory] attributes updated to pass [CallerFilePath]/[CallerLineNumber] to base constructors (v3 requirement)
  • ITestOutputHelper updated with Write/Output members; IAsyncLifetime migrated from TaskValueTask
  • PlatformSpecificFact/PlatformSpecificTheory refactored to use constructor params instead of settable properties
  • Helix infrastructure updated for out-of-process xUnit v3 execution: chmod, codesign, crash dump collection
  • New eng/XUnitV3/ targets and xunit.runner.json configuration

OpenTelemetry telemetry overhaul

  • Telemetry / ITelemetry replaced with TelemetryClient / ITelemetryClient; PersistenceChannel and all PerformanceLog* infrastructure removed
  • OpenTelemetry packages added (Windows-only) replacing Microsoft.ApplicationInsights
  • TelemetryFilter refactored with strongly-typed Filter overloads; TelemetryEventEntry simplified (measurements removed)
  • ApplicationInsightsEntryFormatTelemetryEntryFormat
  • New ActivityContextFactory for propagating trace context to child processes
  • New InvocableOptionAction pattern for --version, --info, --cli-schema, -d options
  • Program.cs restructured: static constructor for early init, ProcessArgsAndExecute, activity-based tracing, signal handling
  • DotNetCommandFactory merged from CommandFactory
  • BuiltInTemplatePackageProvider / OptionalWorkloadProvider updated to use MSBuildForwardingAppWithoutLogging.GetMSBuildSDKsPath() instead of assembly location

Fixes

  • TelemetryFilter: removed incorrect ? nullable annotation from required hash parameter
  • TelemetryDiskLogger: corrected parameter name spelling activiesactivities
Original prompt

Create a PR from the re-apply-xunit.v3 branch that also incorporates all changes from the copilot/un-revert-previous-changes branch. This PR should target main.

The re-apply-xunit.v3 branch contains:

  • Migration from xUnit v2 to xUnit v3 across the test infrastructure
  • Package reference updates (e.g., xunitxunit.v3.core, Microsoft.DotNet.XUnitExtensionsMicrosoft.DotNet.XUnitV3Extensions, Verify.XunitVerify.XunitV3, Microsoft.TemplateEngine.MocksMicrosoft.TemplateEngine.Mocks.XunitV3, etc.)
  • Removal of xunit.console and the custom Program.cs test entry point in favor of xUnit v3's built-in executable model
  • Updates to custom test attributes to pass [CallerFilePath] and [CallerLineNumber] to base xUnit v3 FactAttribute/TheoryAttribute constructors
  • ITestOutputHelper interface changes (adding Write, Output members)
  • IAsyncLifetime changes (TaskValueTask)
  • Helix test infrastructure updates for xUnit v3 out-of-process execution (chmod, codesign, crash dump collection)
  • TheoryData iteration changes for xUnit v3 (ITheoryDataRow usage)
  • Various test fixes for test isolation, ordering, and compatibility
  • New eng/XUnitV3/ targets and runner configuration
  • PlatformSpecificFact/PlatformSpecificTheory refactored to use constructor parameters instead of settable properties (xUnit v3 requirement)
  • MSBuild test discoverer/test case removals (replaced with IBeforeAfterTestAttribute)

The copilot/un-revert-previous-changes branch contains:

  • Major telemetry infrastructure overhaul: replacing Application Insights with OpenTelemetry (on Windows), removing PersistenceChannel, introducing TelemetryClient (replacing Telemetry), ITelemetryClient (replacing ITelemetry)
  • Removal of PerformanceLogEventSource, PerformanceLogEventListener, PerformanceLogManager, and PerformanceMeasurement
  • TelemetryFilter refactored with strongly-typed Filter overloads instead of object-based dispatch
  • TelemetryEventEntry simplified: removal of measurements, strongly-typed SendFiltered overloads
  • ApplicationInsightsEntryFormat renamed to TelemetryEntryFormat (measurements removed)
  • New ActivityContextFactory for propagating trace context to child processes
  • New InvocableOptionAction pattern for --version, --info, --cli-schema, -d (diagnostic) options
  • DotNetCommandFactory merged with CommandFactory (renamed to DotNetCommandFactory.cs)
  • Program.cs substantially restructured: static constructor for early initialization, ProcessArgsAndExecute replacing ProcessArgs, signal handling, activity-based tracing
  • MSBuildLogger updated to use ITelemetryClient instead of ITelemetry
  • Various null-safety improvements and code cleanup throughout
  • BuiltInTemplatePackageProvider and OptionalWorkloadProvider updated to use MSBuildForwardingAppWithoutLogging.GetMSBuildSDKsPath() instead of assembly location
  • Test updates corresponding to all the above changes
  • New environment variable names for telemetry configuration
  • OpenTelemetry packages added (Windows-only) with signing configuration
  • Removal of Microsoft.ApplicationInsights dependency

Both branches should be merged together into a single PR targeting main. Start from the re-apply-xunit.v3 branch and apply (merge/cherry-pick) all commits from copilot/un-revert-previous-changes on top.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: I'd like to create a PR using this branch, re-apply-xunit.v3, targeted against main, that also applies the changes from this branch, copilot/un-revert-previous-changes.

Assistant:

Let me start by gathering information about both branches and understanding the changes involved.

Assistant: The diff for copilot/un-revert-previous-changes is very large - it contains significant changes to telemetry, the CLI structure, and many other areas. Let me now create the PR that combines both branches' changes, using re-apply-xunit.v3 as the source branch and targeting main.

Assistant: I've kicked off the coding agent to create a PR in dotnet/sdk that starts from the re-apply-xunit.v3 branch and merges in the changes from copilot/un-revert-previous-changes, targeting main. The agent is now working on combining both sets of changes — the xUnit v3 migration and the telemetry/infrastructure overhaul — into a single pull request. I'll share the PR link once it's ready.

This pull request was created from Copilot chat.

MichaelSimons and others added 7 commits April 11, 2026 18:38
This reverts commit f788ff9.

Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
Reverts the changes made to DefaultRequestDispatcherTest.cs in
commit 96683a0, restoring the
original Task.Run, SetResult, and simple await patterns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
The dotnet run - (stdin) feature creates a virtual .csproj in a
platform-specific temp directory (~/.local/share/dotnet/runfile/ on
Linux). NuGet walks up from that location to find NuGet.config, but
the test's NuGet.config (with internal feeds like dotnet11-transport)
was only placed in /tmp/dotnetSdkTests/ — a completely different
directory tree. This caused NuGet restore to only find nuget.org,
which doesn't have preview SDK packages.

Fix by copying NuGet.config into the runfile base directory so
NuGet's upward config search finds the test feeds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
This re-applies the OpenTelemetry telemetry changes that were reverted
in PR #53788, without re-applying the xUnit v3 migration (PR #52930).

Key changes:
- Replace ApplicationInsights with OpenTelemetry for telemetry
- Add ITelemetryClient interface replacing ITelemetry
- Add TelemetryClient implementation using OTel
- Update ITelemetryFilter to use typed overloads instead of object parameter
- Update TelemetryFilter with new Filter implementations
- Remove ApplicationInsights NuGet dependency
- Add OpenTelemetry NuGet packages
- Delete PersistenceChannel telemetry infrastructure (no longer needed)
- Delete PerformanceLog infrastructure (replaced by OTel)
- Move test files to TelemetryTests subfolder
- Various nullable annotation improvements

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
…etryDiskLogger spelling

Agent-Logs-Url: https://github.com/dotnet/sdk/sessions/90529bff-35fe-47fe-add8-9ab9ad98caf5

Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants