You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RetryExtensions.AddRetryProvider is the single public wiring entry point for the entire retry-failed-tests feature — it registers the command-line options provider, the test-host application lifetime callback, the composite data-consumer/session-lifetime handler, and the test-host orchestrator. No existing Retry-area test file (RetryTests, RetryDataConsumerTests, RetryArgumentsBuilderTests, RetryOrchestratorHelperTests) exercised this method directly — each one constructs its individual extension class in isolation, so a regression that broke the wiring itself (e.g. forgetting to register one piece, or wiring the pieces to different instances) would go undetected.
Approach
Added RetryExtensionsTests.cs with 3 tests calling AddRetryProvider on a real ITestApplicationBuilder and then driving the platform's own build pipeline to verify the registrations:
Command-line options provider discoverable via the internal CommandLineManager's factory list.
Exactly one test-host-orchestrator factory registered, and it builds a RetryOrchestrator.
The lifecycle callback, data consumer, and test session lifetime handler all resolve to the sameRetryDataConsumer instance (mirrors the real TestHostBuilder pipeline order: lifecycle callback built and registered into the ServiceProvider first, then the composite data-consumer/session-lifetime-handler factory is built with a single shared alreadyBuiltServices list across both calls).
Coverage impact
Before
After
Microsoft.Testing.Extensions.UnitTests (net8.0) total
1876
1879
Failed
0
0
Trade-offs
Uses reflection on the internal CommandLineManager._commandLineProviderFactory field to avoid needing to construct a full IConfiguration just to call CommandLineManager.BuildAsync; this is a bit more coupled to the implementation than an end-to-end call, but keeps the test focused on what AddRetryProvider is responsible for.
Build succeeded (0 warnings/errors) for both net8.0 and net9.0. Targeted suite 3/3 passed. Full Microsoft.Testing.Extensions.UnitTests net8.0 suite: 1879 total, 0 failed, 37 skipped (pre-existing, no regressions). dotnet format whitespace TestFx.slnx --verify-no-changes --include <file> clean (only the expected harmless F#-project warning).
Note
This was originally intended as a pull request, but the git push operation failed.
Original error: The process '/usr/bin/git' failed with exit code 128
🤖 Automated content by GitHub Copilot. Generated by the Test Improver workflow. · copilot · auto · 401 AIC · ⌖ 15 AIC · ⊞ 16.8K · [◷]( · ◷) Comment /test-assist to run again
Add this agentic workflow to your repo
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/test-improver.md@main
Goal and rationale
RetryExtensions.AddRetryProvideris the single public wiring entry point for the entire retry-failed-tests feature — it registers the command-line options provider, the test-host application lifetime callback, the composite data-consumer/session-lifetime handler, and the test-host orchestrator. No existing Retry-area test file (RetryTests,RetryDataConsumerTests,RetryArgumentsBuilderTests,RetryOrchestratorHelperTests) exercised this method directly — each one constructs its individual extension class in isolation, so a regression that broke the wiring itself (e.g. forgetting to register one piece, or wiring the pieces to different instances) would go undetected.Approach
Added
RetryExtensionsTests.cswith 3 tests callingAddRetryProvideron a realITestApplicationBuilderand then driving the platform's own build pipeline to verify the registrations:CommandLineManager's factory list.RetryOrchestrator.RetryDataConsumerinstance (mirrors the realTestHostBuilderpipeline order: lifecycle callback built and registered into theServiceProviderfirst, then the composite data-consumer/session-lifetime-handler factory is built with a single sharedalreadyBuiltServiceslist across both calls).Coverage impact
Microsoft.Testing.Extensions.UnitTests(net8.0) totalTrade-offs
Uses reflection on the internal
CommandLineManager._commandLineProviderFactoryfield to avoid needing to construct a fullIConfigurationjust to callCommandLineManager.BuildAsync; this is a bit more coupled to the implementation than an end-to-end call, but keeps the test focused on whatAddRetryProvideris responsible for.Reproducibility
Test Status
Build succeeded (0 warnings/errors) for both net8.0 and net9.0. Targeted suite 3/3 passed. Full
Microsoft.Testing.Extensions.UnitTestsnet8.0 suite: 1879 total, 0 failed, 37 skipped (pre-existing, no regressions).dotnet format whitespace TestFx.slnx --verify-no-changes --include <file>clean (only the expected harmless F#-project warning).Note
This was originally intended as a pull request, but the git push operation failed.
Original error: The process '/usr/bin/git' failed with exit code 128
Workflow Run: View run details and download bundle artifact
The bundle file is available in the
agentartifact in the workflow run linked above.Create the pull request manually
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
southcentralus0.in.applicationinsights.azure.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run