Skip to content

Report extensions to runners without NUnit.Extensibility.Api types - #28

Merged
CharliesDevBot merged 1 commit into
mainfrom
issue-1980
Dec 5, 2026
Merged

CharliesDevBot merged 1 commit into
mainfrom
issue-1980

Conversation

@CharliesDevBot

Copy link
Copy Markdown
Collaborator

Part of nunit/nunit-console#1980. IExtensionService exposes IExtensionPoint and IExtensionNode from NUnit.Extensibility.Api, so the engine API depends on Extensibility.Api while NUnit.Extensibility depends on the engine API. This PR removes the engine API's side of that cycle before 4.0.0 freezes it.

Changes

  • New data types in NUnit.Engine: ExtensionPointInfo and ExtensionInfo are sealed classes with init-only properties, so members can be added in 4.x without breaking anyone. ExtensionInfoStatus replaces ExtensionStatus. An extension's load error is a string, and its properties are a read-only name-to-values dictionary.
  • IExtensionService: ExtensionPoints and Extensions return the new types. GetExtensionPoint and both GetExtensionNodes overloads are removed. No runner outside the engine calls them, and the engine itself uses its concrete service class.
  • No reference to NUnit.Extensibility.Api: removed from the project and Directory.Packages.props, and the package check for that dependency is dropped from build.cake.

This is a breaking change for runners that list extensions. NUnit.Extensibility needs no code change.

Tests

A new fixture, ExtensionInfoApiTests, checks the shape of the API through reflection, like ExtensionDirectoryApiTests. It checks that the assembly no longer references NUnit.Extensibility.Api, and that no public member uses an Extensibility type. It also covers the interface's members, the new types, their init-only properties and their defaults. All 100 tests pass on net462 and net8.0. The package builds and verifies, with no dependencies.

Follow-up

  • NUnit.Extensibility will pin the MyGet build containing this change.
  • A nunit/nunit-console PR will fill in the new types from the engine's extension nodes, and use them in the console's --list-extensions output and its --enable and --disable options.
  • The TestCentric GUI's extension dialog will be updated separately.

Claude prepared this PR through a bot account, as in the trial described on nunit/nunit-console#1983.

🤖 Generated with Claude Code

IExtensionService now lists extensions with plain data types defined in the
engine API: ExtensionPointInfo, ExtensionInfo and ExtensionInfoStatus.
GetExtensionPoint and both GetExtensionNodes overloads are removed. The engine
API no longer references NUnit.Extensibility.Api, which removes its side of
the dependency cycle (nunit/nunit-console#1980).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@CharliePoole CharliePoole left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good step toward eliminating dependency on extensibility api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants