我正在尝试在DIFF视图中为phabricator设置覆盖率报告。我有以下配置:
.arcconfig
{
"project_id" : "SuperProject",
"conduit_uri" : "https://phabricator.dev/",
"unit.engine": "PhpunitTestEngine",
"unit.phpunit.binary": "./vendor/bin/phpunit",
"phpunit_config": "tests/phpunit.xml"
}
测试/ phpunit.xml
<phpunit>
<testsuite name="unit">
<directory suffix="Test.php">unit/accountancy</directory>
....
<directory suffix="Test.php">unit/store</directory>
</testsuite>
<logging>
<log type="coverage-clover" target="../build/logs/clover.xml" />
</logging>
</phpunit>
但是当我运行arc unit --coverage --json
时,我会得到以下内容:
{
"0": {
"namespace": null,
"name": "Restriction\\CalculatorTest::testGetDiscount with data set #0",
"link": null,
"result": "pass",
"duration": 0.00362205505371,
"extra": null,
"userData": "",
"coverage": [] <-- why is it empty?
},
...
}
似乎arcanist没有获取覆盖范围信息。我已经尝试过查看phabricator源代码,但无法找到如何启用它的线索。
非常欢迎任何建议!
答案 0 :(得分:-2)
将白名单添加到您的tests / phpunit.xml中。查看https://phpunit.de/manual/current/en/code-coverage-analysis.html#code-coverage-analysis.whitelisting-files