]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix bug with `arc unit --everything` when coverage is available
authorepriestley <git@epriestley.com>
Wed, 6 Mar 2013 21:39:31 +0000 (13:39 -0800)
committerepriestley <git@epriestley.com>
Wed, 6 Mar 2013 21:39:31 +0000 (13:39 -0800)
Summary: We don't set $paths when running --everything.

Test Plan: Ran `arc unit --everything` with coverage.

Reviewers: vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D5260

src/unit/engine/phutil/ArcanistPhutilTestCase.php

index 3f7d450754fe145c5daa201e52e0f65d184bd395..b1cef23afc1ac3080f2943a062447216a7abade3 100644 (file)
@@ -508,8 +508,12 @@ abstract class ArcanistPhutilTestCase {
       $coverage[substr($file, strlen($this->projectRoot) + 1)] = $str;
     }
 
-    // Only keep coverage information for files modified by the change.
-    $coverage = array_select_keys($coverage, $this->paths);
+    // Only keep coverage information for files modified by the change. In
+    // the case of --everything, we won't have paths, so just return all the
+    // coverage data.
+    if ($this->paths) {
+      $coverage = array_select_keys($coverage, $this->paths);
+    }
 
     return $coverage;
   }