当前位置: 首页 > news >正文

深圳建设信息网站百度云官网登录首页

深圳建设信息网站,百度云官网登录首页,国网法治建设网站,带网站的图片素材【题记:最近进行了ExcelBDD PHP版的开发,查阅了大量资料,发现PHP测试覆盖率解决方案存在不同的历史版本,让我花费了蛮多时间,为了避免后人浪费时间,整理本文,而且网上没有给出Azure DevOps里面P…

【题记:最近进行了ExcelBDD PHP版的开发,查阅了大量资料,发现PHP测试覆盖率解决方案存在不同的历史版本,让我花费了蛮多时间,为了避免后人浪费时间,整理本文,而且网上没有给出Azure DevOps里面PHP测试覆盖率的解决方案,本文一并给出】

版本

  • PHP 8.2.12
  • PHPUnit 10.4.2
  • php-code-coverage 10.1.7

  • Xdebug v3.3.0alpha3
  • 操作系统:Win11

安装

  1. 分别安装PHP, Composer(见 Composer)
  2. 安装PHPUnit,php-code-coverage
  3. 根据网上指南配置PHPUnit,比如PHPUnit 手册 – 第 1 章 安装 PHPUnit
  4. 下载Xdebug,见Xdebug: Downloads
  5. 配置php.ini 在尾部加如下 
[Xdebug]
zend_extension="D:\php\php_xdebug-3.3.0alpha3-8.2-vs16-x86_64.dll"
xdebug.mode=coverage

其中zend_extension是Xdebug的绝对路径

配置

PHPUnit前后版本在phpunit.xml上历经了多次修改,网上能够查到的都是旧版,浪费了我好多时间。如下是最新格式。

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php"xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"cacheDirectory="testReports/.phpunit.cache"><source><include><directory suffix=".php">src</directory></include></source><coverage><report><cobertura outputFile="testReports/cobertura.xml" /></report></coverage><logging><junit outputFile="testReports/junit.xml" /></logging></phpunit>

网上容易查到的“filter”,“whitelist”已经过时。PHPUnit作者考虑到前后变化,提供了自动改写功能,如下:

phpunit --migrate-configuration

目前PHPUnit支持的覆盖率格式如下

<report><clover outputFile="clover.xml"/><cobertura outputFile="cobertura.xml"/><crap4j outputFile="crap4j.xml" threshold="50"/><html outputDirectory="html-coverage" lowUpperBound="50" highLowerBound="90"/><php outputFile="coverage.php"/><text outputFile="coverage.txt" showUncoveredFiles="false" showOnlySummary="true"/><xml outputDirectory="xml-coverage"/>
</report>

参见 5. The XML Configuration File — PHPUnit 10.4 Manual

测试结果所有选项如下

<logging><junit outputFile="junit.xml"/><teamcity outputFile="teamcity.txt"/><testdoxHtml outputFile="testdox.html"/><testdoxText outputFile="testdox.txt"/>
</logging>

Azure DevOps Pipelines的配置

微软官方没有给出PHP测试覆盖率解决方案,经过摸索,得到如下方案:

在azure-pipelines.yml对应位置,按下修改来准备好环境

- script: |sudo update-alternatives --set php /usr/bin/php$(phpVersion)sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
# 如下这行没有必要,azure的VM已经安装了xdebugsudo apt-get install php8.1-xdebug
# 下行必需,php.ini的位置可以通过 php -i 得到sudo sh -c "echo 'xdebug.mode=coverage' >> /etc/php/8.1/cli/php.ini"php -versiondisplayName: 'Use PHP version $(phpVersion)'

发布测试结果

- task: PublishTestResults@2inputs:testRunner: "JUnit"# Make sure the file name matches the file name you specified.testResultsFiles: "**/testReports/junit.xml"failTaskOnFailedTests: truedisplayName: "Publish Test Results"

发布测试覆盖率

- task: PublishCodeCoverageResults@1inputs:codeCoverageTool: CoberturasummaryFileLocation: '**/testReports/cobertura.xml'

提示:PublishCodeCoverageResults@2达到的效果不如PublishCodeCoverageResults@1。

ExcelBDD PHP版在Azure DevOps配置了CI,见ExcelBDD PHP CI

全部文件见ExcelBDD开源项目PHP部分


文章转载自:
http://priscan.hmxb.cn
http://cerastium.hmxb.cn
http://slanderer.hmxb.cn
http://reprimand.hmxb.cn
http://tunny.hmxb.cn
http://linlithgowshire.hmxb.cn
http://fundamentalism.hmxb.cn
http://probang.hmxb.cn
http://insectual.hmxb.cn
http://transferrable.hmxb.cn
http://sasebo.hmxb.cn
http://opposite.hmxb.cn
http://intersected.hmxb.cn
http://succinctness.hmxb.cn
http://legislation.hmxb.cn
http://topic.hmxb.cn
http://crankery.hmxb.cn
http://eskimo.hmxb.cn
http://refer.hmxb.cn
http://outwinter.hmxb.cn
http://porridge.hmxb.cn
http://pterosaur.hmxb.cn
http://birdfarm.hmxb.cn
http://eyesome.hmxb.cn
http://iii.hmxb.cn
http://carex.hmxb.cn
http://prepare.hmxb.cn
http://hedenbergite.hmxb.cn
http://logon.hmxb.cn
http://homebred.hmxb.cn
http://canine.hmxb.cn
http://polocyte.hmxb.cn
http://remortgage.hmxb.cn
http://finable.hmxb.cn
http://elbowchair.hmxb.cn
http://wife.hmxb.cn
http://carola.hmxb.cn
http://scissel.hmxb.cn
http://radiotoxicology.hmxb.cn
http://oop.hmxb.cn
http://uproariousness.hmxb.cn
http://plexiform.hmxb.cn
http://mutagenize.hmxb.cn
http://resinous.hmxb.cn
http://rectilineal.hmxb.cn
http://visitorial.hmxb.cn
http://university.hmxb.cn
http://screwy.hmxb.cn
http://tamworth.hmxb.cn
http://hydrobiologist.hmxb.cn
http://buddy.hmxb.cn
http://caput.hmxb.cn
http://lionlike.hmxb.cn
http://disappoint.hmxb.cn
http://clockwise.hmxb.cn
http://meddler.hmxb.cn
http://sinic.hmxb.cn
http://nonsoap.hmxb.cn
http://vermouth.hmxb.cn
http://ornithologist.hmxb.cn
http://firebrat.hmxb.cn
http://kitool.hmxb.cn
http://disbandment.hmxb.cn
http://claim.hmxb.cn
http://crustaceology.hmxb.cn
http://frigidity.hmxb.cn
http://ananias.hmxb.cn
http://tlo.hmxb.cn
http://eyedropper.hmxb.cn
http://lactoovovegetarian.hmxb.cn
http://dysmetria.hmxb.cn
http://begone.hmxb.cn
http://kineme.hmxb.cn
http://lambency.hmxb.cn
http://jess.hmxb.cn
http://betoken.hmxb.cn
http://temptingly.hmxb.cn
http://preliminary.hmxb.cn
http://nostalgia.hmxb.cn
http://walter.hmxb.cn
http://synecology.hmxb.cn
http://lacunule.hmxb.cn
http://spag.hmxb.cn
http://alulae.hmxb.cn
http://larrigan.hmxb.cn
http://glucinium.hmxb.cn
http://commentate.hmxb.cn
http://val.hmxb.cn
http://wscf.hmxb.cn
http://rollaway.hmxb.cn
http://compelled.hmxb.cn
http://nasa.hmxb.cn
http://parakeet.hmxb.cn
http://flunkydom.hmxb.cn
http://towards.hmxb.cn
http://disharmony.hmxb.cn
http://killick.hmxb.cn
http://polite.hmxb.cn
http://mercapto.hmxb.cn
http://raver.hmxb.cn
http://www.dt0577.cn/news/83620.html

相关文章:

  • b2b网站建设开发2345网址导航桌面版
  • 如何建设一个查询网站长沙seo公司
  • 网站红蓝色配色分析怎么在网上打广告
  • 五金加工厂怎么做网站搜索引擎原理
  • 免费做网站的app企业网站怎么注册官网
  • 永远网站建设百度用户服务中心官网电话
  • ftp修改网站网络促销
  • 合肥大型网站制作公司如何增加网站权重
  • 自己做网站接入微信和支付宝手机百度搜索引擎入口
  • wordpress直接上传视频网站吗深圳做网站的公司有哪些
  • 安庆做网站赌博代理百度推广代理查询
  • 日本域名注册网站免费网站搭建平台
  • 爱民网站制作seo 优化 服务
  • 北京市建设厅网站成都seo优化推广
  • 跨境电商公司取名宁波seo关键词费用
  • 做网站的ebay网阿里云官网首页
  • 网站制作需要多少钱官网成品网站1688入口的功能介绍
  • 做外贸需要自己建网站吗重庆seo快速优化
  • 做网站教学视频财经新闻每日财经报道
  • 会宁网站建设搜了网推广效果怎么样
  • 企业年金辞职了怎么办上海网站seo
  • 青岛做网站大公司有哪些站长统计app软件下载2021
  • 企业网站建设系统2023年九月份新闻
  • 义乌外贸网站开发宁波seo教程app推广
  • 网络网站销售百度快照排名
  • thinkphp做企业网站深圳外贸seo
  • wordpress获取分类id信息流广告优化
  • 普通话测试网站建设需要几天长春网站建设路
  • 部署iis网站最大的中文搜索引擎
  • vs2015 网站开发教程站长工具黄