]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Aggregate display of postponed tests
authorslawekbiel <slawekbiel@fb.com>
Thu, 28 Apr 2011 18:46:20 +0000 (11:46 -0700)
committerslawekbiel <slawekbiel@fb.com>
Thu, 28 Apr 2011 19:05:00 +0000 (12:05 -0700)
Summary:
Displaying each postponed test separately was spammy.
Now it will only display a single line with the total count

Test Plan:
~/local/arcanist/bin/arc unit --sandcastle-tests
35 tests to run.
Completed 'ParentInfoTestCase.php'
Interrupted 'MentionsUntagTestCase.php'
    PASS  ParentInfoTestCase
  POSTPONED  34 tests

Reviewed By: sgrimm
Reviewers: jungejason, sgrimm
CC: sgrimm
Revert Plan:
sure

Other Notes:

Differential Revision: 173

src/workflow/unit/ArcanistUnitWorkflow.php

index 567a736983ca7794b2cfba4ebe048ccfeb76baf7..c706ce9e14bf6265f338568f492503e483827045 100644 (file)
@@ -115,14 +115,26 @@ EOTEXT
       );
 
     $unresolved = array();
+    $postponed_count = 0;
     foreach ($results as $result) {
       $result_code = $result->getResult();
-      echo $status_codes[$result_code].' '.$result->getName()."\n";
-      if ($result_code != ArcanistUnitTestResult::RESULT_PASS) {
-        echo $result->getUserData()."\n";
-        $unresolved[] = $result;
+      if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED) {
+        $postponed_count++;
+      } else {
+        echo $status_codes[$result_code].' '.$result->getName()."\n";
+        if ($result_code != ArcanistUnitTestResult::RESULT_PASS) {
+          echo $result->getUserData()."\n";
+          $unresolved[] = $result;
+        }
       }
     }
+    if ($postponed_count) {
+      echo sprintf("%s %d %s\n",
+         $status_codes[ArcanistUnitTestResult::RESULT_POSTPONED],
+         $postponed_count,
+         ($postponed_count > 1)?'tests':'test');
+    }
+
     $this->unresolvedTests = $unresolved;
 
     $overall_result = self::RESULT_OKAY;