承接 hot/phpunit-runner 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hot/phpunit-runner

Composer 安装命令:

composer require hot/phpunit-runner

包简介

The lib allows to watch phpunit tests

README 文档

README

Requirements: php, phpunit, git, find

Watcher for php classes and tests

bin/hot-phpunit-runner --config=app/phpunit.xml --watch

  • When you change entity XXXClass this watcher looking for and run tests for this entity.
  • When you change test for entity XXXClassTest this watcher run this test too.
PHPUnit HotRunner has been started


> phpunit -c app/phpunit.xml ./src/.../....../XXXClassTest.php

PHPUnit 3.7.21 by Sebastian Bergmann.

Configuration read from /Users/slava/project/xxx/app/phpunit.xml

....

Time: 1 second, Memory: 10.00Mb

OK (4 tests, 9 assertions)


[OK]

[notice] If you run bin/hot-phpunit-runner without any options then you run all tests (or test for entity) based on git status (one time). FYI, runner will not run tests next time. ( result is cached for watcher )

Default running looks like:

  • bin/hot-phpunit-runner --watch
  • bin/hot-phpunit-runner --config=app/phpunit.xml --watch

Options

 --config=app/phpunit.xml # custom phpunit config file
 --phpunit-options="-c app/ --testdox" # custom phpunit options (alternative for `--config`)
 --phpunit-bin=bin/phpunit # custom path to phpunit
 --watch # watcher mode
 --period=2 # sec. watcher period
 --clean # this option remove cached result and re-test full
 --test-similarity=100 # percentage of similarity 0..100 (entity vs test)
 --coverage=coverage.xml # collect coverage and write Clover xml
 --on-pass="echo 'pass callback';" # CLI command after pass
 --on-fail="echo 'fail callback';" # CLI command after fail
 --notify # notifications # OSX / UBUNTU notifications

Install

Workflows

  1. bin/hot-phpunit-runner --watch # default watcher
  2. bin/hot-phpunit-runner --config=app/phpunit.xml --watch # with phpunit config file
  3. bin/hot-phpunit-runner --config=app/phpunit.xml --phpunit-bin=bin/phpunit --watch # with custom phpunit
  4. bin/hot-phpunit-runner --clean # clear cache and re-test changeset (when watcher working)
  5. bin/hot-phpunit-runner --config=app/phpunit.xml --watch --period=1 # with phpunit config hot watcher with --period=1
  6. bin/hot-phpunit-runner --config=app/phpunit.xml --watch & # with phpunit config file and with & (background process)
  7. bin/hot-phpunit-runner --watch --test-similarity=50 # default watcher with --test-similarity=50 # watcher can not find my tests. I need to reduce the similarity.
  8. bin/hot-phpunit-runner --options="-c app/ --testdox" --watch # watcher with --options="-c app/ --testdox" # with custom phpunit options
  9. bin/hot-phpunit-runner --config=app/phpunit.xml --coverage=coverage.xml --watch # with --config=app/phpunit.xml --coverage=coverage.xml. collect coverage just for changes
  10. bin/hot-phpunit-runner --notify --watch # OSX / UBUNTU notifications

PhpStorm

Highlight coverage in PhpStorm

bin/hot-phpunit-runner --config=app/phpunit.xml --coverage=coverage.xml --watch # required --config=app/phpunit.xml phpunit config file, in this case runner collect coverage for changes

plugin: download wiki home

PhpStorm settings

PhpStorm highlight

or

PhpStorm highlight

Notifications

bin/hot-phpunit-runner --notify --watch

osx notification

ubuntu notification

--notify has dependents:

hot/phpunit-runner 适用场景与选型建议

hot/phpunit-runner 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 66.99k 次下载、GitHub Stars 达 29, 最近一次更新时间为 2013 年 09 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「phpunit」 「git」 「test」 「ci」 「observer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hot/phpunit-runner 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hot/phpunit-runner 我们能提供哪些服务?
定制开发 / 二次开发

基于 hot/phpunit-runner 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 66.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 30
  • 点击次数: 27
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 29
  • Watchers: 6
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-17