Skip to content

Rename RegisterTestFramework adapterFactory parameter to frameworkFactory#5691

Merged
nohwnd merged 4 commits into
mainfrom
copilot/fix-2443
Jun 4, 2025
Merged

Rename RegisterTestFramework adapterFactory parameter to frameworkFactory#5691
nohwnd merged 4 commits into
mainfrom
copilot/fix-2443

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2025

This PR renames the adapterFactory parameter to frameworkFactory in the Microsoft.Testing.Platform.Builder.ITestApplicationBuilder.RegisterTestFramework public API.

Changes Made

  • Renamed adapterFactory parameter to frameworkFactory in ITestApplicationBuilder.RegisterTestFramework method signature
  • Updated XML documentation for the parameter to reflect the new name
  • Updated the implementation in TestApplicationBuilder.cs to use the new parameter name
  • Updated parameter validation and assignment to use the new name

Breaking Change Impact

This is a code-breaking change for calls that use the parameter name explicitly (e.g., frameworkFactory: value). However, it is not a binary-breaking change - all existing code using positional parameters will continue to work without recompilation.

Based on the analysis, major test frameworks (TUnit, NUnit, xUnit.net) do not use named parameters for this method, so the impact is minimal.

Rationale

The previous naming adapterFactory was leaking implementation details from MSTest's VSTest compatible implementation and did not fit the generic interface semantics. The new name frameworkFactory better represents the purpose of this parameter in the generic testing platform context.

Fixes #2443.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 8xbvsblobprodcus382.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)
  • bcnvsblobprodcus378.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)
  • http://168.63.129.16:80/machine/
    • Triggering command: /usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs (http block)
  • i1qvsblobprodcus353.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)
  • mfjvsblobprodcus373.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)
  • s4uvsblobprodcus326.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)
  • s8mvsblobprodcus38.vsblob.vsassets.io
    • Triggering command: dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj --configuration Release (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…tory

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Copilot AI changed the title [WIP] Rename RegisterTestFramework adapterFactory parameter Rename RegisterTestFramework adapterFactory parameter to frameworkFactory Jun 3, 2025
Copilot AI requested a review from Youssef1313 June 3, 2025 19:21
Copy link
Copy Markdown
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

LGTM. @nohwnd I'll let you decide if you are okay with the super small break here.

@Youssef1313 Youssef1313 marked this pull request as ready for review June 3, 2025 19:24
@Youssef1313
Copy link
Copy Markdown
Member

@copilot Fix these two errors:

src/Platform/Microsoft.Testing.Platform/Builder/ITestApplicationBuilder.cs(52,29): error RS0016: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.Testing.Platform.Builder.ITestApplicationBuilder.RegisterTestFramework(System.Func<System.IServiceProvider!, Microsoft.Testing.Platform.Capabilities.TestFramework.ITestFrameworkCapabilities!>! capabilitiesFactory, System.Func<Microsoft.Testing.Platform.Capabilities.TestFramework.ITestFrameworkCapabilities!, System.IServiceProvider!, Microsoft.Testing.Platform.Extensions.TestFramework.ITestFramework!>! frameworkFactory) -> Microsoft.Testing.Platform.Builder.ITestApplicationBuilder!' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)
src/Platform/Microsoft.Testing.Platform/PublicAPI/PublicAPI.Shipped.txt(96,1): error RS0017: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.Testing.Platform.Builder.ITestApplicationBuilder.RegisterTestFramework(System.Func<System.IServiceProvider!, Microsoft.Testing.Platform.Capabilities.TestFramework.ITestFrameworkCapabilities!>! capabilitiesFactory, System.Func<Microsoft.Testing.Platform.Capabilities.TestFramework.ITestFrameworkCapabilities!, System.IServiceProvider!, Microsoft.Testing.Platform.Extensions.TestFramework.ITestFramework!>! adapterFactory) -> Microsoft.Testing.Platform.Builder.ITestApplicationBuilder!' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

…name

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 3, 2025

@copilot Fix these two errors:

...

Fixed the Public API analyzer errors. The issue was that the parameter rename created a breaking change that needed to be properly tracked:

  • Removed the old API signature with adapterFactory from PublicAPI.Shipped.txt
  • Added the new API signature with frameworkFactory to PublicAPI.Unshipped.txt

This properly tracks the breaking change as an API removal + addition. Fixed in commit ee2de0f.

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
@nohwnd nohwnd enabled auto-merge (squash) June 4, 2025 10:32
@nohwnd nohwnd merged commit 1894061 into main Jun 4, 2025
8 checks passed
@nohwnd nohwnd deleted the copilot/fix-2443 branch June 4, 2025 10:58
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.

Rename RegisterTestFramework adapterFactory parameter

4 participants