I am trying to update our ui tests to geb 5 and spock 2 where a major change is that they now use JUnit instead of TestNG.
Our geb tests have run fine with setForkEvery(1)
so far (we do not have that many of them and running each test takes a long time anyway, so we figured it’s easier to start each test with a fresh db/app state).
However after switching to useJUnitPlatform()
hundreds of gradle Test Executors are run unnecessarily.
The build now takes 20 minutes longer.
With INFO level logging there is just a pause of 20 minutes.
With debug logging you can see that gradle runs lots of Test Executor that just test nothing at all.
For testing I deleted all except 2 test classes, but that did not change anything.
If I set a test filter to a single class it works fine and fast. If I have no test filter or a test filter with a wildcard the delay happens.
This is my test configuration:
tasks.test {
maxHeapSize = "768m"
useJUnitPlatform()
setForkEvery(1)
}