Skip to content

Need replacement for EngineVersion checking #1752

@CharliePoole

Description

@CharliePoole

UPDATED 19 Oct 2025

Because NUnit Extensibility was designed for the engine, the ExtensionAttribute supports a property 'EngineVersion, which is checked by ExtensionManager`. However, the V4 update to the extensibility model envisions its use by other NUnit components than just the engine and even other applications... TestCentric for example. When hosted by other components or applications, the host version will not necessarily be the same as the NUnit version.

It would be possible, of course, to continue to use the NUnit engine version and require other hosts to pick some engine version with which they are compatible. This would require no changes to the NUnit.Extensibility package but would put a large burden on any other users.

The alternative proposed here would replace the existing EngineVersion with two new properties:

  1. ExtensiibilityVersion, to represent the level of the extensibility model used by the extension.
  2. HostVersion, to represent the level of functionality the extension requires from the host.

The host would need to check both these versions before installing the extension using something like the following pseudo-code:

if the version of extensibility I am using >= ExtensibilityVersion and my version >= HostVersion
    install the extension

For the engine as it is today both checks will require a minimum value of 4.0. My TestCentric runner would probably use 4.0 and 2.0 for the minimum extensibility and host values. Similarly if any other NUnit packages were to use this feature, two different values would be needed. (Thinking of NUnitLite here)

NOTES:

  1. Although the 4.0 engine could continue to support EngineVersion when it is found, I'm not in favor of that. It makes the logic slightly more complicated and seems unnecessary since all extensions will need to be rewritten for 4.0 anyway.
  2. The ExtensibilityVersion property would be supported on the ExtensionAttribute just as EngineVersion is now.
  3. The HostVersion property may be more appropriate on the ExtensionPointAttribute. Some experimentation is needed.
  4. Any host is free to assume a default value if either property is not found. The host would, of course, need to deal with any resulting failures.
  5. Any extension that is designed to be used on multiple hosts should probably use ExtensionPointAttribute rather than TypeExtensionPointAttribute. The latter is a shortcut that works best for extensions that are embedded in the host itself.
  6. This proposal should be considered as experimental at this point. As we work with it, we may want to consider modifications before the final 4.0 release.@nunit/engine-team Thoughts?

Metadata

Metadata

Assignees

Labels

Design DecisionFeatureV4All issues related to V4 or later - use -label:V4 to get V3 issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions