我在Yii2中通過竹CI服務器運行Codeception並使用SonarQube來幫助運行分析。Codeception&SonarQube PHP [無法讀取phpUnit報告]
到目前爲止,我已經設法讓SonarPHP分析PHP - 這非常棒。但是我一直無法得到它包括報道報道。我正在製作一份三葉草報道報道。
這是我codecept命令:
${bamboo.php} ${bamboo.composer} exec codecept run unit models/HelperTest.php -- --xml --coverage --coverage-xml
sonar.projectKey=CR
sonar.projectName=CCasper Reporting
sonar.projectVersion=4.0
sonar.language=php
sonar.sources=models, controllers, components, modules/api/models, modules/api/controllers
sonar.sourceEncoding=UTF-8
sonar.tests=tests/api/models, tests/unit/models
sonar.php.tests.reportPath=tests/bamboo/report.xml
sonar.php.coverage.reportPath=tests/bamboo/coverage.xml
sonar.php.coverage.itReportPath=tests/bamboo/coverage.xml
sonar.coverage.exclusions=tests/*.php
java.lang.IllegalStateException:無法讀取PHPUnit的報告:com.thoughtworks.xstream:由造成report.xml將 。 mapper.CannotResolveClassException:testsuites:testsuites
我假設這是因爲生成文件:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="unit" tests="2" assertions="2" errors="0" failures="0" skipped="0" time="0.015625">
<testcase name="testGetRange" class="tests\models\HelperTest" file="C:\bamboo-home\xml-data\build-dir\CR-QA-JOB1\tests\unit\models\HelperTest.php" assertions="1" time="0.015625"/>
<testcase name="testBadDateCheckerParam" class="tests\models\HelperTest" file="C:\bamboo-home\xml-data\build-dir\CR-QA-JOB1\tests\unit\models\HelperTest.php" assertions="1" time="0.000000"/>
</testsuite>
</testsuites>
所以我的問題是,我如何得到SonarPHP 5.5.6正確納入覆蓋面?
什麼是SonarPHP和SQ你的版本使用? –
嗨@ElenaVilchik我已經在下面回答了我的問題。如果我的設置中缺少某些可能對其他人有用的信息,請告知我。 – Jonnny