I noticed that Groovy and Java versions in the Groovy test runner are outdated (Groovy 3 and Java 11), so no recent features are supported, like records or switch expressions.
Updating both is quite an endeavor:
Groovy 4 requires JDK 16+ to build
Groovy changed its package groupId since version 4
Groovy deprecated groovy-all activate since version 4
The Spock version is also dependent on the Groovy version.
But since groovy-test-runner is pretty independent of exercises’ Gradle configs (it runs on maven with its own pre-downloaded list of dependencies), I think it should be possible to bump the runner first (and have the exercise dependency update PR ready too to merge shortly after).
There aren’t any deprecated language features, at least according to the release notes.
Does anyone have any concerns already?
I’m planning to at least check reference Groovy exercises solutions to pass the tests to get some estimate of backwards compatibility.
P.S. When running locally, I have a little issue with list-ops reference solution, but according to stackoverflow, it’s related to JDK flavor, not Groovy or Spock version.
And now the last remaining part: bumping the Docker JDK version to make the latest Java features like records available. There are a few issues, though:
latest available maven:<...>-jdk-<...> (the flavor the runner currently uses) is Java 14
latest available slim image is 3.8.5-openjdk-17-slim, but the base openJDK image has been deprecated
This smells like something to do with the test runner not having internet in production.
The very last comment in [MNG-7713] Drop option legacy-local-repository - ASF JIRA also suggests something regarding internet access, but I just ran ./bin/run-reference-solution-tests-in-docker.sh (without re-building the Docker image) on my laptop with WiFi turned off, and it didn’t fail. And there’s already a --offline flag in the maven command. Am I missing something?
There can just be a lot of subtleties. For example, for Elixir, you have to give it a network device to detect (but no actual internet), otherwise it hangs for 20 seconds waiting for network.
If it’s not doing anything harmful, I’d just leave it personally. Chesterton’s Fence etc. But if it’s causing a problem, we can investigate more.
Is there a way to simulate the test runner environment as on the website or run it one-off with a different Docker image?
Git history (Switch to Maven by andreaTP · Pull Request #18 · exercism/groovy-test-runner · GitHub) says -llr was added in a single commit with maven migration, so it must have been somehow tested while working on that commit
I did some more reading on the -llr flag, and some sources suggest the flag might be needed on environments with multiple Maven processes might run simultaneously, but I guess that’s not the case for the test runner, right?
Before I create a roll-back PR: is the new image pushed to the workers automatically? Or is it expected to have a few timeouts once the image is updated?