-
Notifications
You must be signed in to change notification settings - Fork 161
Description
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:
ExtensiibilityVersion, to represent the level of the extensibility model used by the extension.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:
- Although the 4.0 engine could continue to support
EngineVersionwhen 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. - The
ExtensibilityVersionproperty would be supported on theExtensionAttributejust asEngineVersionis now. - The
HostVersionproperty may be more appropriate on theExtensionPointAttribute. Some experimentation is needed. - 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.
- Any extension that is designed to be used on multiple hosts should probably use
ExtensionPointAttributerather thanTypeExtensionPointAttribute. The latter is a shortcut that works best for extensions that are embedded in the host itself. - 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?