PrioTestCI: Efficient Test Case Prioritization in GitHub Workflows for CI Optimization
Continuous Integration (CI) is a widely adopted practice in software development to automatically verify code changes across diverse environments. However, executing the full test suite on every pull request update can lead to redundant runs, slower feedback loops, and inefficient utilization of CI resources. To tackle this issue, we present PrioTestCI, a prioritization technique within GitHub Actions that focuses on re-executing test cases that previously failed. If these prioritized tests succeed, the remaining tests proceed; otherwise, the workflow terminates early, saving computation resources and providing early feedback to developers. PrioTestCI uses commit-to-commit test result tracking to inform future test runs, effectively reducing unnecessary repetition and speeding up validation cycles. We evaluated our technique on the Pytest project, a real-world open-source project with an extensive test matrix. PrioTestCI led to a CI runtime reduction of 1h57m39s in comparison to the normal workflow, with individual configuration improvements ranging from 63.75% to 91.94% (81.55% on average). Demo video: https://youtu.be/_3CF9LJdv0I?si=XyE_8mBnDxk1lMnD Repository: https://github.com/ShubhamDesai/CI-Optimization