]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Send postponed test results to differential.
authortuomaspelkonen <tuomaspelkonen@fb.com>
Wed, 8 Jun 2011 23:36:17 +0000 (16:36 -0700)
committertuomaspelkonen <tuomaspelkonen@fb.com>
Thu, 9 Jun 2011 17:29:54 +0000 (10:29 -0700)
Summary:
Differential showed 'okay' as the arc unit status even when there were
postponed tests.

Test Plan:
Tested that test results were pushed to differential when there were
postponed tests.

Reviewed By: jungejason
Reviewers: epriestley, jungejason
CC: slawekbiel, aran, jungejason
Differential Revision: 417

src/workflow/diff/ArcanistDiffWorkflow.php
src/workflow/unit/ArcanistUnitWorkflow.php

index f21e5f67ac9cf85712e3be73e29271b7e86ffddf..25ff3d332346073a0ffb4dd171df155ee233b30f 100644 (file)
@@ -244,6 +244,8 @@ EOTEXT
       $unit = 'warn';
     } else if ($unit_result === ArcanistUnitWorkflow::RESULT_SKIP) {
       $unit = 'skip';
+    } else if ($unit_result === ArcanistUnitWorkflow::RESULT_POSTPONED) {
+      $unit = 'postponed';
     } else {
       $unit = 'none';
     }
index 46c6511b711934a188d6fb890ee156cfe0bf4f46..cc92c61625fae154fb01896d0ec3da732f02c493 100644 (file)
  */
 class ArcanistUnitWorkflow extends ArcanistBaseWorkflow {
 
-  const RESULT_OKAY     = 0;
-  const RESULT_UNSOUND  = 1;
-  const RESULT_FAIL     = 2;
-  const RESULT_SKIP     = 3;
+  const RESULT_OKAY      = 0;
+  const RESULT_UNSOUND   = 1;
+  const RESULT_FAIL      = 2;
+  const RESULT_SKIP      = 3;
+  const RESULT_POSTPONED = 4;
 
   private $unresolvedTests;
   private $engine;
@@ -121,6 +122,7 @@ EOTEXT
       $result_code = $result->getResult();
       if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED) {
         $postponed_count++;
+        $unresolved[] = $result;
       } else {
         if ($this->engine->shouldEchoTestResults()) {
           echo '  '.$status_codes[$result_code].' '.$result->getName()."\n";
@@ -151,6 +153,9 @@ EOTEXT
         break;
       } else if ($result_code == ArcanistUnitTestResult::RESULT_UNSOUND) {
         $overall_result = self::RESULT_UNSOUND;
+      } else if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED &&
+                 $overall_result != self::RESULT_UNSOUND) {
+        $overall_result = self::RESULT_POSTPONED;
       }
     }