0

我正在尝试在 phabricator 的 DIFF 视图中设置覆盖率报告。我有以下配置:

.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?
  },
  ...
}

似乎奥术师没有收集报道信息。我什至尝试过查看 phabricator 源代码,但找不到有关如何启用它的线索。

非常欢迎任何建议!

4

1 回答 1

-2

白名单添加到您的测试/phpunit.xml。检查https://phpunit.de/manual/current/en/code-coverage-analysis.html#code-coverage-analysis.whitelisting-files

于 2017-12-22T09:28:40.203 回答