Migration help - Running individual unit tests on a unique JVM

Hi all,

I’m running into a problem with migrating an old maven project to gradle. The project has some awful unit tests that are run on unique JVM instances per test, not even per test class. As defined by the surefire plugin:


I’ve seen that Gradle supports forkEvery = 1 to run test classes on unique JVM instances, but I need to go one step further. Manually fixing these tests could take beyond the heat death of the universe, and I’m kinda short on time. :wink:

Any thoughts if it’s possible to run the tests on individual JVM instances? I’m not so bothered about the tests taking longer (for now), I plan on coming back to this.


Seems I was mistaken about the perTest forkmode. I understood it as a per test case behaviour, but it seems to be synonymous with surefire’s always, according to stackoverflow and the surefire jira board.

forkEvery = 1 should_do what I’m after.