mediawiki/phpunit-patch-coverage
Composer 安装命令:
composer require mediawiki/phpunit-patch-coverage
包简介
Generate coverage reports for git patches
README 文档
README
A tool to generate coverage reports for a Git patch without actually running the entire coverage report.
Purpose
Running PHPUnit coverage reports with Xdebug can be extremely slow. For example, the MediaWiki core coverage report takes around 2 hours to run. This makes it hard for developers to get quick feedback on their patches to see how they affected the overall coverage.
The goal of this is to be able to generate coverage reports for Git patches without running the full coverage tests.
Implementation
We look at the files that were changed in the last commit. We identify classes that were changed, as well as tests that were changed. We then find all the tests that cover those classes, and run the tests with coverage for those files.
Next we'll checkout the previous commit, and re-calculate to see which tests should be run (@covers and modified files). We'll re-run the coverage, and then diff the result!
There are probably plenty of edge cases where this won't work, but I think it will do reasonably well.
Usage
Add the composer dependency to your project:
composer require --dev mediawiki/phpunit-patch-coverage
The current working directory must be your git repository. With full options:
./vendor/bin/phpunit-patch-coverage check \
--command "php vendor/bin/phpunit" \
--sha1 HEAD
The options shown in the example above are the defaults, and do not need to
be specified again. You may find it useful to have xdebug disabled by
default, and then specify it at runtime with:
php -d zend_extension=xdebug.so ....
Or if you have a PHPUnit wrapper (like MediaWiki), you can call that.
License
phpunit-patch-coverage is (C) 2018 Kunal Mehta, under the terms of the GPL v3 or any later version. See COPYING for more details.
mediawiki/phpunit-patch-coverage 适用场景与选型建议
mediawiki/phpunit-patch-coverage 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.74k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mediawiki/phpunit-patch-coverage 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mediawiki/phpunit-patch-coverage 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-01-20