ColdFusion Test Coverage Reports: Integrating TestBox With GitHub Actions and SonarQube
说明与用途
使用 TestBox、FusionReactor、GitHub Actions 和 SonarQube 自动收集并发布 ColdFusion 的测试覆盖率报告,确保在合并前覆盖率不低于设定阈值。
问题
ColdFusion projects lack automated test coverage reporting and quality gates, making it hard to ensure code is adequately tested before merging.
结果
The team now has automated coverage reporting integrated into their CI pipeline, enabling pull request reviews to include coverage metrics and preventing merges that would lower coverage below the defined threshold.
工作流
- Configure TestBox to enable coverage and set coverageSonarQubeXMLOutputPath
- Install FusionReactor license and run it via CommandBox to instrument bytecode
- Create GitHub Actions workflow that checks out code, installs CommandBox, runs TestBox tests, and uploads coverage XML
- Publish HTML report to GitHub Pages or artifact
- Configure SonarQube with stepstone-tech/sonar-coldfusion plugin
- Add SonarQube analysis step in GitHub Actions that feeds the TestBox coverage XML
- Set SonarQube quality gate to enforce minimum coverage threshold
证据
TestBox’s code coverage requires a licensed copy of FusionReactor connected to the app under test
TestBox can emit a SonarQube-compatible coverage XML directly (coverageSonarQubeXMLOutputPath)
- 记录日期: 2026-09-21T12:45:30.376Z