Skip to content

Breaking change in version 4.4.0-beta.1 #5011

Description

@OsirisTerje

@manfred-brands @stevenaw

I ran the beta version on some production code, which use a test library that depends on NUnit.4.3.2, and got two tests failing due to MissingMethod exceptions.

This seems to come from changes in the EqualConstraint, and might be from PR #4925 .

I ran it through ChatGPT (o4-mini-high), and asked it to figure out what changes may have caused it, and got some results (which may or may not be the correct one though). The ChatGPT response is at the bottom here.

The failing tests came out with these messages and stacktraces:

Message: 
System.MissingMethodException : Method not found: 'NUnit.Framework.Constraints.EqualConstraint NUnit.Framework.Constraints.ConstraintExpression.EqualTo(!!0)'.

  Stack Trace: 
ClientCredentialKeyPairsConfigConsistencyTests.ThatClientIdForProductionIsDifferentThanTest()
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
1)    at Fhi.ClientCredentials.TestSupport.ClientCredentialKeyPairsConfigConsistencyTests.ThatClientIdForProductionIsDifferentThanTest()
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

The Assert line that fails is

Assert.That(clientCredentialsConfigurationForProduction!.ClientId, Is.Not.EqualTo(clientIds.First()), "ClientId for production is equal to clientId used for tests");

This is a breaking change, there might also be others, since we have touched more than the EqualConstraint, e.g. SomeItemsConstraint has also been touched.
However, for those just updating and do not have mixed packages, the update is non-breaking (I believe).

We have to decide how to resolve it:

  1. Just mark the PR as breaking, and list it in the release notes as a breaking change, but keep it as version 4.4.0.

PRO: Easy fix, can document exactly HOW it breaks, and what to be aware of

CON: Breaks SemVer, and might confuse users who expect a minor version to not introduce breaking changes.

  1. Update to version 5.0.0

PRO: Marks it as a breaking change release, follows SemVer

CON: These are kind of inadvertently breaking changes, and very few - might be only one.

  1. Introduce a shim method to cover it

PRO: Will make the release non-breasking

CON: Might not be easy, seems it is the return value that is the issue.

Vote ?


Chat GPT response:

Image

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions