✅ How to create ridiculously fast test suites
✅ How to implement parallelization
"Once you have these automated tests, our analysis shows it’s important to run them regularly. Every commit should trigger a build of the software and running a set of fast, automated tests. Developers should get feedback from a more comprehensive suite of acceptance and performance tests every day. Furthermore, current builds should be available to testers for exploratory testing." (Nicole Forsgren PhD, Jez Humble, Gene Kim, Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations)
Try to run the current suite of tests:
mvn test -Dtest="E2ESolutionTests,VisualDataDrivenSolutionTests"
This is how long my tests took
241 sec/8 tests = 30 sec/test
- Go to
pom.xml
and add the following at the same level as the<dependencies>
node
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<parallel>all</parallel>
<threadCountMethods>100</threadCountMethods>
<useUnlimitedThreads>true</useUnlimitedThreads>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
</plugin>
</plugins>
</build>
- In terminal run
mvn test -Dtest="E2ESolutionTests,VisualDataDrivenSolutionTests"
- Login to saucelabs.com and watch tests run in parallel
My results
✅ 78% speed improvement in < 5 min
✅ 0 degradation to our test quality
✅ Enabled parallel scaling
✅ Parallel testing is awesome