I've found that sometimes my coverage reports are incorrect based on what appears to be some sort of idiosyncrasy in PHPUnit's --coverage-clover output, most notably when running arc diff against either a directory or a lot of files. Basically, the Clover coverage is giving false positives on which lines are not covered vs those which are unreachable. I'd wager this is some weird artifact of PHP7 being so new and some sort of static analysis being off, but that's beside the point.
From arc diff --detailed-coverage src/
Running on a single file isn't affected due to the way the coverage aggregation works; arc diff --detailed-coverage src/SignRequest.php
This patch fixes it for me, but I don't know if there are broader implications for other languages or test runners. If it looks OK I'll re-submit this as a diff. All it does is give preference to "not reachable" over "uncovered" when combining coverage reports.
diff --git a/src/unit/ArcanistUnitTestResult.php b/src/unit/ArcanistUnitTestResult.php index a0dc2f7..b01b63c 100644 --- a/src/unit/ArcanistUnitTestResult.php +++ b/src/unit/ArcanistUnitTestResult.php @@ -137,6 +137,9 @@ final class ArcanistUnitTestResult extends Phobject { if ($more_coverage[$ii] == 'C') { $base[$ii] = 'C'; } + if ($more_coverage[$ii] == 'N' && $base[$ii] = 'U') { + $base[$ii] = 'N'; + } } // If a secondary report has more data, copy all of it over.