一句话:提出 PrioTestCI,在 GitHub Actions 中优先重跑曾失败测试,失败则提前终止,从而缩短 CI 时间。
持续集成中每次拉取请求更新都运行完整测试套件,会造成冗余执行、反馈变慢和资源浪费。PrioTestCI 是集成于 GitHub Actions 的测试用例优先级技术:它基于 commit 到 commit 的测试结果跟踪,优先重新执行此前失败的测试;若这些测试通过,再运行其余测试,否则提前终止工作流,从而节省计算资源并尽早向开发者反馈。作者在真实开源项目 Pytest 上评估,该项目包含大规模测试矩阵。相比普通工作流,PrioTestCI 将 CI 运行时间减少 1 小时 57 分 39 秒,各配置改进为 63.75% 至 91.94%,平均 81.55%。
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 address this issue, we introduce PrioTestCI, a prioritization technique within GitHub Actions that focuses on re-executing test cases that have 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 utilizes commit-to-commit test result tracking to inform future test runs, thereby reducing unnecessary repetition and accelerating validation cycles. We evaluated our technique on the Pytest project, a real-world open-source project with an extensive test matrix. PrioTestCI resulted in a CI runtime reduction of 1h57m39s compared 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
DOI 原文 ·
@inproceedings{paperbot9215,
title = {PrioTestCI: Efficient Test Case Prioritization in GitHub Workflows for CI Optimization},
author = {Shubham Vasudeo Desai and Shonil Bhide and Souhaila Serbout and Luciano Marchezan and Wesley K. G. Assunção},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00365}
}