MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.69k stars 1.34k forks source link

faster multiproject test runs with parallelization #4576

Open keturn opened 3 years ago

keturn commented 3 years ago

One way to spend less time waiting for tests is to throw more hardware at them.

4417 adds parallel test execution to the tests for engine. Workspaces where you have a lot of modules checked out at once (i.e. omega) could do a similar thing at a higher level, running compilation and testing tasks in multiple modules in parallel.

This involves scheduling execution across multiple subprojects, so it'll be done at the level of Gradle configuration rather than Jupiter.

We have a lot of modules. We would probably get more than enough parallelization by gradle parallel task execution without needing to configure anything specific to testing: https://docs.gradle.org/6.8.3/userguide/performance.html#parallel_execution

If the bottleneck is one module with a lot of slow tests, gradle also offers has a parallelization setting specifically for tests: https://docs.gradle.org/current/userguide/java_testing.html#sec:test_execution

Success metrics:

keturn commented 3 years ago

I tried running tests in omega using the --parallel command line flag here on my i7-6700 workstation (4 physical cores + hyperthreading).

gradlew clean :extractConfig :extractNatives test --parallel --scan

Key takeaways:

Other notes:

keturn commented 3 years ago

In the interest of having individual actionable tickets for people to pick up, follow-up issues have been made:

jdrueckert commented 3 years ago

parallelize module unit tests