Skip to content

Open up orchestrator experimentally#7409

Open
Evangelink wants to merge 9 commits intomainfrom
dev/amauryleve/orchestrator
Open

Open up orchestrator experimentally#7409
Evangelink wants to merge 9 commits intomainfrom
dev/amauryleve/orchestrator

Conversation

@Evangelink
Copy link
Member

Fix #5554

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes the test host orchestrator functionality as a public experimental API to enable third-party extensions to implement custom orchestration strategies (e.g., distributing tests across processes/machines or implementing custom retry logic).

Changes:

  • Made ITestHostOrchestrator and ITestHostOrchestratorManager public interfaces with experimental attribute
  • Created IInternalTestHostOrchestratorManager to retain internal-only members while exposing core functionality publicly
  • Added TestHostOrchestrator property to ITestApplicationBuilder as an experimental public API
  • Simplified RetryExtensions to use the new public API instead of casting to internal types

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ITestHostOrchestrator.cs Made interface public and added XML documentation and experimental attribute
ITestHostOrchestratorManager.cs Split into public interface with experimental attribute and internal interface for advanced functionality
TestHostOrchestratorManager.cs Updated to implement the internal interface
ITestHostBuilder.cs Updated to use internal interface type
TestHostBuilder.cs Updated to use internal interface type
ITestApplicationBuilder.cs Added public experimental property for TestHostOrchestrator
TestApplicationBuilder.cs Implemented public experimental property for TestHostOrchestrator
PublicAPI.Unshipped.txt Added public API entries for new orchestrator interfaces and property
RetryExtensions.cs Simplified to use public API instead of internal casting

Co-authored-by: Youssef Victor <youssefvictor00@gmail.com>
Copilot AI review requested due to automatic review settings February 20, 2026 11:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings March 5, 2026 14:37
@Evangelink Evangelink enabled auto-merge March 5, 2026 14:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Comment on lines +4 to +12
// These types provide binary backward compatibility for extensions compiled
// against older platform versions where the orchestrator manager type lived in the
// Microsoft.Testing.Platform.Extensions.TestHostOrchestrator namespace.
namespace Microsoft.Testing.Platform.Extensions.TestHostOrchestrator;

internal interface ITestHostOrchestratorManager
{
void AddTestHostOrchestrator(Func<IServiceProvider, ITestHostExecutionOrchestrator> factory);
}
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

OrchestratorBackCompat claims to provide binary backward compatibility, but the back-compat ITestHostOrchestratorManager no longer matches the previously existing contract (it now accepts ITestHostExecutionOrchestrator and omits members like AddTestHostOrchestratorApplicationLifetime / BuildAsync). This will break load-time compatibility for older extension assemblies compiled against the old internal orchestrator APIs (e.g., older Retry versions) and can cause TypeLoadException/MissingMethodException. Consider reintroducing shims for the old ITestHostOrchestrator/manager shapes (old signatures + members) that forward to the new public APIs, and have the new manager implement/adapt them explicitly.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. Added the missing ITestHostOrchestrator back-compat shim type (extends ITestHostExecutionOrchestrator) and updated the back-compat ITestHostOrchestratorManager to match the old contract:

  • AddTestHostOrchestrator now accepts Func<IServiceProvider, ITestHostOrchestrator> (old type name)
  • Added AddTestHostOrchestratorApplicationLifetime member
  • The concrete TestHostOrchestratorManager explicitly implements both old signatures, forwarding to the new public APIs

BuildAsync is not included in the back-compat interface since it took ServiceProvider (platform-internal) and was only called by internal platform code (which has been updated).

Microsoft.Testing.Platform.Extensions.TestHostControllers.ITestHostProcessLifetimeHandler.OnTestHostProcessStartedAsync(Microsoft.Testing.Platform.Extensions.TestHostControllers.ITestHostProcessInformation! testHostProcessInformation, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task!
[TPEXP]Microsoft.Testing.Platform.Extensions.TestHostOrchestrator.ITestHostExecutionOrchestrator
[TPEXP]Microsoft.Testing.Platform.Extensions.TestHostOrchestrator.ITestHostExecutionOrchestrator.OrchestrateTestHostExecutionAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<int>!
Microsoft.Testing.Platform.Builder.ITestApplicationBuilder.TestHostOrchestrator.get -> Microsoft.Testing.Platform.TestHostOrchestrator.ITestHostOrchestratorManager!
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

ITestApplicationBuilder.TestHostOrchestrator is marked [Experimental("TPEXP", ...)], but its entry in PublicAPI.Unshipped.txt is missing the [TPEXP] prefix. This can cause API compatibility validation to treat it as a non-experimental shipped API; prefix it consistently with the other experimental entries.

Suggested change
Microsoft.Testing.Platform.Builder.ITestApplicationBuilder.TestHostOrchestrator.get -> Microsoft.Testing.Platform.TestHostOrchestrator.ITestHostOrchestratorManager!
[TPEXP]Microsoft.Testing.Platform.Builder.ITestApplicationBuilder.TestHostOrchestrator.get -> Microsoft.Testing.Platform.TestHostOrchestrator.ITestHostOrchestratorManager!

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Checked existing conventions in PublicAPI.Shipped.txt — the other [Experimental] properties on ITestApplicationBuilder (Configuration.get, Logging.get) are not prefixed with [TPEXP] in the API files. Only the experimental types/methods themselves carry the prefix. Keeping the entry without [TPEXP] to stay consistent (the build also fails RS0016/RS0017 validation with the prefix added).

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.

Open up test host orchestrator for public consumption experimentally

3 participants