Closed StefH closed 5 months ago
I think version 1.5.46 of WireMock.Net.Testcontainers is not compatible with Testcontainers version 3.7.0. The constructor for ContainerConfiguration
has changed slightly. I am sorry for this breaking change; while we internally forward and pass the correct data type to the configuration, I did not consider this specific scenario. Under normal usage (not mixing versions), this issue will not happen. This explains #1059. However, I am uncertain if the same situation applies to the other issue. Is it possible that the user is utilizing WireMock.Net.Testcontainers with a newer version of Testcontainers than the one used by the WireMock package?
It is probably a good idea to pin the Testcontainers version for upcoming WireMock releases. You will likely run into similar issues with version 3.8.0, which introduces the reuse feature that extends the configuration constructor as well.
Is it possible that the user is utilizing WireMock.Net.Testcontainers with a newer version of Testcontainers than the one used by the WireMock package?
Yes, in issue https://github.com/WireMock-Net/WireMock.Net/issues/1059 this is indeed described by the user : Testcontainers.CosmosDb version 3.7.0 is used.
@HofmeisterAn Thanks for looking into this issue, it's really appreciated.
I've some follow-up questions on this topic:
Is it allowed (according to your design) to inherit from the ContainerConfiguration class?
Pinning the version to 3.7.0 will work fine when no other Testcontainer is used except for WireMock.Net, if another is used and that one is using version 3.6.0 (and only 3.6.0 exists) then there is again NuGet version conflict.
If you expect breaking changes configuration constructor in the next version; isn't there a way to keep the existing constructor the same?
Yes, in issue WireMock-Net/WireMock.Net#1059 this is indeed described by the user : Testcontainers.CosmosDb version 3.7.0 is used.
What about the other issue?
Is it allowed (according to your design) to inherit from the ContainerConfiguration class?
Yes, it is allowed. We are doing it as well.
If if is allowed, then no breaking changes should be introduced?
It is not really a breaking change. There is nothing to do or to consider when switching from version 3.6.0 to 3.7.0. In your case, users are mixing (overwriting) versions that may not be (are) compatible with each other. This can also happen with other (transitive) dependencies. WireMock can specify compatible version ranges. Maybe we can do the same for all modules, requiring the same Testcontainers base version per module (then you do not need to do it). But I need to look into this first.
If you expect breaking changes configuration constructor in the next version; isn't there a way to keep the existing constructor the same?
Usually, we try to avoid breaking changes as much as we can. If it is not possible, we mention it in the release notes, but in this case, I do not really count it as a breaking change. Otherwise, we wouldn't be able to properly ship new versions. Mixing versions was never intended. But I can understand that the situation is not really great. I hope we can pin our modules to the base version. Then this issue should not happen again.
What about the other issue?
I don't know yet, I'm waiting on the user to respond... I'll keep you updated.
@HofmeisterAn I just got confirmation that it is indeed related to 3.7.0 (https://github.com/WireMock-Net/WireMock.Net/issues/1054#issuecomment-1909605082)
So for now I'll pin the version in WireMock.Net to [3.7.0]
.
I kept thinking about this issue and did not come up with another solution. If you have any other ideas, I am happy to discuss them. However, since the users overwrite the dependency with a new version, I do not know what else I/we should do.
So for now I'll pin the version in WireMock.Net to
[3.7.0]
.
It would be interesting if we can do the same for the ProjectReference
.
I kept thinking about this issue and did not come up with another solution. If you have any other ideas, I am happy to discuss them. However, since the users overwrite the dependency with a new version, I do not know what else I/we should do.
Normally, users are allowed to use a newer version. This is also the case when I want to use a newer version from a Microsoft dependency. I think it all relates to the fact that the public interfaces/classes should be backwards compatible. If this rule is applied, using an higher version should be possible.
FYI: a new NuGet from WireMock.Net has been released which pins the version from testcontainers to 3.7.0
I did some research, but unfortunately, I have not found a lot of useful information except that pinning project references is not supported right now. There is a "hacky" workaround which I have not looked into closely. I will close this issue because I have no plans to add the workaround. In case you find other information or want to continue discussing this issue and behavior, do not hesitate to reopen the issue. Thanks for the awareness and creating the issue.
Testcontainers version
3.7.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
.NET version
8
Docker version
Docker info
What happened?
System.MissingMethodException when upgrading from 3.6.0 to 3.7.0
Was there a breaking change in 3.7.0 or when using .NET 8 ?
Relevant log output
Exceptions:
Additional information
Related bugs reported: