testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.05k stars 1.66k forks source link

[Feature]: Spock integration should not export Spock dependency #7540

Open musketyr opened 1 year ago

musketyr commented 1 year ago

Module

None

Problem

Spock is always released against the multiple Major versions of Groovy. For example version 2.3 has been released for Groovy 2.5, 3,0 and 4.0.

Upgrading Groovy is non-trivial tasks and it's not possible for many frameworks to upgrade to the latest Groovy.

Solution

Revert to not exporting the Spock dependency into the POM as it was before 1.18.0

Benefit

Testcontainers Spock can be upgraded beyond 1.17.6 for developers not using yet Groovy 4

Alternatives

Publish the Spock artifacts fore ach Groovy version the same way how Spock is doing

Would you like to help contributing this feature?

Yes

eddumelendez commented 1 year ago

Hi @musketyr, great catch! This is similar to what happened with junit jupiter. So, this should apply to spock as well. However, I'm not sure about how to handle the different versions 🤔 My initial thought is using the minimum version in the module and create some examples for the other two versions and test compatibility. Unless, just testing with the minimum ensures it works with the major versions.

musketyr commented 1 year ago

I don't think the API is different between these variants of versions. Only the pulled transient dependency is what matters. It should be safe to use the lowest Groovy version possible (2.3-groovy-2.5) and if there is a higher one in the resolution graph then it will win.

musketyr commented 1 year ago

@melix haven't you have to problem with https://github.com/micronaut-projects/micronaut-test-resources? or do you always have a good match of Spock and Groovy? I would like to hear your expert voice here.