Skip to content

Use the public agent provider contract - #1935

Closed
oznetmaster wants to merge 1 commit into
nunit:mainfrom
oznetmaster:refactor/public-agent-provider-contract
Closed

oznetmaster wants to merge 1 commit into
nunit:mainfrom
oznetmaster:refactor/public-agent-provider-contract

Conversation

@oznetmaster

Copy link
Copy Markdown
Collaborator

The public ITestAgentProvider contract is now merged in nunit/nunit.engine.api#22. Remove the engine's internal copy so the engine and independently compiled providers share one type identity, and adopt the agreed GetAgent / ReturnAgent names throughout the built-in providers, coordinator, runner and test-server helpers.

This is based on current main after merged #1933 (341a47c). The originating-provider ownership and local shutdown correction remain intact. Existing launcher/registration interfaces, wire command names, provider order, and default local selection are unchanged. TestAgency is not renamed here; the proposed TestAgentService rename remains separate. The unused legacy service receives the required member rename but is not activated or otherwise refactored.

Dependency

Use the actual public MyGet NUnit.Engine.Api 4.0.0-beta.101.2. A downloaded package independently verifies repository commit 900dc3829484f2b20ccb20f547d407f6e6e508d4 (the #22 merge), the public ReturnAgent contract and both library targets. NuGet source mapping routes only this exact package ID to MyGet; other dependencies remain on their existing sources. No package is rebuilt or overwritten. Please coordinate the eventual NuGet release pin; this specific intermediate build follows the current development base and is not described as a stable public release.

Validation on Windows

  • Both engine/console targets and common test targets build with repository analyzers enabled, zero warnings/errors.
  • Engine unit suites: net462 429 passed; net10.0 421 passed; zero failures, 11 existing ignored/explicit cases each. All 21 agent-exit cases, the ownership/shutdown regressions and five contract-identity cases pass on both targets.
  • Existing provider-server integration: 11/11 passed on each engine runtime using unchanged public .NET Framework/.NET 10 agent packages, including discovery, exact execution, events, stop, connection loss, return and cleanup controls.
  • Console unit suites: net462 305 passed, net10.0 295 passed; zero failures, four skips each.
  • Common suites: net462 353 passed, net8.0 337 passed; zero failures, one warning and one inconclusive case each (retained in the receipts, not counted as passes).
  • A separate provider assembly references only the public API package. A separate host successfully supplies it to the engine, acquires an agent and returns the exact reference to that provider on net462 and net10.0. Reflection verifies the contract lives in the API assembly and is absent from the engine assembly.
  • A declaration comparison confirms that modified existing C# changes only ReleaseAgent(...) to ReturnAgent(...) plus XML comments. The duplicate interface deletion and added identity tests are explicit. Whitespace checks pass and the full-index patch independently reconstructs the tested tree.

The initial whole-solution build exposed a missing installed .NET 7 FrameworkList.xml in two unrelated standalone mock-fixture targets. That failed attempt is retained. The supported engine/console/common target builds pass separately; no machine-wide SDK or production-source workaround was made. This PR does not claim a successful all-fixture solution build or fresh Linux/macOS, GUI, adapter or physical-backend validation.

Prepared by Neil Colvin with assistance from OpenAI Codex.

Consume the published API beta.101.2, remove the engine-local duplicate,
and adopt ReturnAgent throughout providers, callers and test helpers.
Retain existing wire commands and provider ownership behavior.

Prepared by Neil Colvin with assistance from OpenAI Codex.
@oznetmaster

Copy link
Copy Markdown
Collaborator Author

#1936 has incorporated the public provider API adoption and renamed the coordinator to TestAgentService. The additional five public-contract identity regressions from this draft are retained in the refreshed #1934.

Closing this draft as superseded avoids competing API-adoption changes; it does not discard those regressions or the remote-provider work.

Prepared by Neil Colvin with assistance from OpenAI Codex.

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.

1 participant