The Problem: Long Time Test Execution in CI/CD
Test suites have grown in size and complexity. What used to be a quick validation step has become a bottleneck that can significantly impact development velocity. CI/CD pipelines that take a long time to complete are delaying feedback and deployments, creating frustration for developers and slowing down the entire development process. Here is the reality many teams face:
- Large test suites with hundreds or thousands of tests
- Long-running integration tests that interact with databases, APIs, or external services
- CI/CD pipelines that take 20+ minutes to complete, delaying feedback and deployments
The Solution: Distributed Test Execution
The solution is to distribute test execution across multiple machines, running different test groups in parallel. This approach can reduce test execution time by 70-90%.
Results may vary
Key Benefits
- Significantly faster feedback loops and shorter deployment cycles - From 20 minutes to 4 minutes in our example
- Scalable - Easy to adjust number of runners based on test suite size and available resources
Implementation: The parTestGroup
SBT Task
The core of this solution is a custom SBT task that divides tests into groups and allows running specific groups independently.