如果代码覆盖率报告权限较小,则构建应会失败 [英] build should fail if code coverage Report Percenatge is less

查看:92
本文介绍了如果代码覆盖率报告权限较小,则构建应会失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个build.xml用于通过phing生成报告.

I have written a build.xml for generating Reports through phing.

我在build.xml中添加了以下命令以生成代码覆盖率报告:::

I have added below command in build.xml to generate code coverage Report ::

<exec command="phpunit  --coverage-html ./code_Coverage_Report codecoverage_test/CodeCoverage.php "/>

现在,我想在build.xml中添加一个检查,如果我的代码覆盖率报告百分比小于85%,则构建应该会自动失败.

Now i wanted to add a check in build.xml that if my code coverage Report percentage is less than 85% then the build should automatically fail.

推荐答案

PHPUnit无法做到这一点.有一个请求请求来实现您想要的,但是被拒绝了.

This is not possible with PHPUnit. There was a pull request to implement what you want, but it was rejected.

https://github.com/sebastianbergmann/phpunit/pull/2402

这篇关于如果代码覆盖率报告权限较小,则构建应会失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆