When running tests using --tests
, gradle seems to initialize other tests (although it does not run them) this significantly adds to test run times. This makes it unbearable when running with forkEvery
option, because gradle forks for each test, and does nothing I’ve even tried using
filter.includeTestsMatching
to see if that affects the test run time.
I’ve setup a sample project to demonstrate this over on my github account (https://github.com/ketan/gradle-bug-report)
Here’s a snippet of the output from my actual build to demonstrate how severe the problem is, with thousands of tests, each test taking an average of 100ms seconds to do nothing, it adds up to several minutes to skip them.
Running Gradle Test Executor 1
Running com.thoughtworks.go.config.BackgroundEmailSenderTest
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.051 sec
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.058 sec
Running Gradle Test Executor 2
Running com.thoughtworks.go.config.CachedGoConfigIntegrationTest
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.228 sec
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.234 sec
Running Gradle Test Executor 3
Running com.thoughtworks.go.config.CachedGoConfigTest
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.1 sec
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.106 sec
Running Gradle Test Executor 4
Running com.thoughtworks.go.config.CachedGoPartialsTest
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.071 sec
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.078 sec
Running Gradle Test Executor 5
Running com.thoughtworks.go.config.ConfigCipherUpdaterTest
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.176 sec
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.184 sec
Running Gradle Test Executor 6
Running com.thoughtworks.go.config.ConfigConverterTest
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.193 sec
Tests run: 0, Failures: 0, Skipped: 0, Time elapsed: 0.202 sec
Running Gradle Test Executor 7