shawnveltman/testmetrics
Composer 安装命令:
composer require shawnveltman/testmetrics
包简介
A few helpers to profile your test suite
README 文档
README
An easy way to find slow tests within your application. Since Laravel Parallel Testing allows for JUnit logging, this is simply a JUnit xml parser that grabs simple stats (setup time, average test time after setup) for each test suite, to hilight those that are the slowest.
Installation
You can install the package via composer:
composer require shawnveltman/testmetrics
After installation, be sure to add the following lines to your phpunit.xml file:
<logging> <junit outputFile="junit.xml"/> </logging>
Finally, be sure to add the junit.xml to your gitignore.
Usage
Now, after you run your parallel tests, you will have the junit.xml file. Grab the contents of that file as a string, and pass it to the test_results_parser method, then print your results. That's it!
$testmetrics = new Shawnveltman\Testmetrics(); echo $testmetrics->test_results_parser(contents: $file_contents)->print_results();
Alternately, you can pass a filepath instead of string contents.
$testmetrics = new \Shawnveltman\Testmetrics\Testmetrics(); $path = base_path('junit.xml'); echo $testmetrics->test_results_parser(path: $path)->print_results();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 223
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-13