Search code examples
scalagradlescalatest

Do Scalatests run in parallel by default under Gradle?


We have tests written in Scala using Scalatest and JUnit4. The tests are annotated with @RunWith(classOf[JUnitRunner]). We're using Gradle 4.2.x and I'd like to know, if the Scala tests are executing in parallel by default.


Solution

  • I think for parallel running you will need to add something like this to your test in build.gradle

    test {    
          maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1      
        }