企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# C.7 CoverageThresholdTask This task validates the code coverage database and will stop the build cycle if any class or method or entire project's coverage is lower than the specified threshold. Table C.8:聽Attributes NameTypeDescriptionDefaultRequired`database``String`The location of the coverage database. (This is optional if `CoverageSetupTask` has run before.)n/aNo`perProject``Integer`The minimum code coverage for the entire project.25No`perClass``Integer`The minimum code coverage for any class.25No`perMethod``Integer`The minimum code coverage for any method.25No`verbose``Boolean`Whether to enable detailed logging or not.`false`No C.7.1 Example `<coverage-threshold database="./reports/coverage.db"/>` C.7.2 Supported Nested Tags - `classpath` - `excludes` Validates an optional code coverage database against the default thresholds. ``` <coverage-threshold perProject="50" perClass="60" perMethod="70"/> ``` Validates the code coverage database (from CoverageSetupTask) against the specified thresholds. ``` <coverage-threshold perProject="50" perClass="60" perMethod="70"/> <excludes> <file>**/*Processor.php</file> <class>Model_Filter_Windows</class> <method>Model_System::execute()</method> </excludes> ``` Validates the code coverage database (from CoverageSetupTask) against the specified thresholds and excludes the given file, class and method from threshold validation. The filename is relative to the project basedir. A Method can be named either "Model\_System::execute()" or "Model\_System::execute". The method name is considered only for the given class "Model\_System".