Gradle Incremental Test Runner
Article Summary
Swiggy's Android team was stuck in a painful cycle: rebasing PRs, waiting hours for full test suites to run, then doing it all over again. One frustrated engineer decided to fix it over a weekend.
Anik Raj C from Swiggy's Android team built a Gradle Incremental Test Runner that identifies which tests actually need to run based on code changes. Instead of running thousands of tests on every PR, the tool uses git diff and intelligent file searching to run only relevant tests.
Key Takeaways
- Reduced average test run time from hours to just 6 minutes
- Uses git diff and grep to map changed files to related tests
- Runs locally on developer machines, eliminating CI wait times
- Cuts CI compute costs dramatically by running subset of tests
- Built initial prototype using bash scripts over one weekend
Critical Insight
By running only relevant tests instead of the entire suite, Swiggy reduced test time to 6 minutes and slashed CI costs while improving developer productivity.