【发布时间】:2021-11-10 07:09:40
【问题描述】:
我有一个包含大量测试的 Laravel 项目。我正在使用 pcov 计算代码覆盖率,大约需要 4 分钟。但是 pcov 不支持分支覆盖,所以我决定使用 xdebug 。
使用 xdebug 测试执行,有代码覆盖但没有 --path-coverage(分支覆盖)大约需要 8 分钟。
但是使用 xdebug、代码覆盖和 --path-coverage(分支覆盖)测试执行需要超过 2 个小时,甚至不能等到结束:
INFO[2021-09-14 21:33:24] Executing runtests with coverage xdebug
XDEBUG_MODE=coverage
php artisan test --parallel --processes=8 --verbose --passthru=--path-coverage tests/Feature --coverage-text
Warming cache for static analysis ... done [00:00.071]
............S................................................ 61 / 1180 ( 5%)
............................................................. 122 / 1180 ( 10%)
............................................................. 183 / 1180 ( 15%)
............................................................. 244 / 1180 ( 20%)
.......
INFO[2021-09-15 00:00:05] finished in 2h 26m 40.458565176s
所以我的问题是 --path-coverage 需要超过 100 倍的执行时间是否正常?
【问题讨论】:
标签: phpunit code-coverage xdebug