Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the plugin works with Gradle 7 #158

Closed
bsautel opened this issue Mar 25, 2021 · 7 comments
Closed

Ensure the plugin works with Gradle 7 #158

bsautel opened this issue Mar 25, 2021 · 7 comments

Comments

@bsautel
Copy link
Contributor

bsautel commented Mar 25, 2021

Gradle 7.0-rc1 was recently published. We should ensure that the plugin works using Gradle 7.

@bsautel
Copy link
Contributor Author

bsautel commented Mar 25, 2021

I tried to upgrade Gradle to 7.0-rc1 in the plugin build. Unfortunately, the tests cannot run because Gradle 7 uses Groovy 3 and Spock 1.3 (the production version) is only compatible with Groovy 2.x and not with Groovy 3.

It sounds like the solution is to use the latest milestone of Spock 2.0. That's what Gradle did in their code base. But this is not so simple. I created an extension that runs the tests using multiple Gradle versions. Spock changed the extensions behavior. I tried multiple things, but I cannot get the method parameter extension work. According to the documentation, the code that worked with Spock 1 should keep working with Spock 2 and can be simplified because the arguments array will always have the right size. That's unfortunately not what happens when running the extension. The arguments array is empty (whereas it should contain 1 element of GradleVersion type). If I enlarge it using as we did in the v1, it tells me that it is larger than the method parameters (0). I don't understand why the GradleVersion parameter is ignored by Spock.

For now, I am not able to build the plugin using Gradle 7. As a workaround, I added Gradle 7 as a Gradle version against which the integration tests need to be executed. The tests are passing on my laptop, I pushed the code in a branch to the test-gradle-7 to ensure it will work on GitHub Actions. It adds yet another tests execution repetition, so the tests should still take more time. Maybe we should remove one version, for instance 6.0. We already test against the latest 5.x, if we do the same thing with the latest 6.x and the current 7.x, it will maybe be enough?

@bsautel
Copy link
Contributor Author

bsautel commented Mar 25, 2021

I reported the Spock issue I encountered with Spock at spockframework/spock#1305.

@deepy
Copy link
Member

deepy commented Mar 25, 2021

On the bright side, I don't think we need to try building with Gradle 7.0-rc1, we don't have an elaborate setup so apart from plugin incompatibility I we should be fine.
But the list of versions to test is a great place :-)

I think at this point we might start reconsidering the support for Gradle 5, not as in intentionally removing it but dropping the automated tests for it during the next major, which I guess could be shortly after the release of 7.0

@henrik242
Copy link

I've used the Spock milestones (currently 2.0-M5-groovy-3.0) for ages in large production code bases. No issues so far!

@bsautel
Copy link
Contributor Author

bsautel commented Mar 26, 2021

@deepy You are right, while we don't want to use Gradle 7 specific APIs, we do not need to use the latest Gradle version. But even if it is not mandatory, it's still better to use the latest version. That's the reason why I investigated this Spockframework issue.

For now, adding Gradle 7 to the list of tested versions should be sufficient. So as far as I understand you would be in favor to replace the latest Gradle 5 by the newest Gradle 7?

And thanks @henrik242 for your feedback. I don't know why I did not use the M5 release. But I just come to test and the issue is also present in the M5 milestone.

@deepy
Copy link
Member

deepy commented Mar 26, 2021

I'm 100% with you in regards to using the latest version, I think at the moment we might just have to live with having even slower tests until our next major where we drop 5.6.4 from the versions to be tested (and maybe log a warning from the plugin that we've dropped support for <6 in that version).

And we could release that major a few days after 7.0 is released, in fact we could probably open the discussion about dropping Gradle 5 support entirely so we can remove some of the awkward things we had to do to get 5, 6, and configuration cache support

@bsautel
Copy link
Contributor Author

bsautel commented Mar 26, 2021

Ok, I see what you mean. So I am going to merge the branch I created that adds tests against Gradle 7.0-rc1.

And I'm ok to think about dropping Gradle 5 support. Thanks for your answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants