]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't ask for confirmation with unsound unit tests
authorvrana <jakubv@fb.com>
Mon, 16 Jul 2012 22:54:11 +0000 (15:54 -0700)
committervrana <jakubv@fb.com>
Wed, 15 Aug 2012 22:49:50 +0000 (15:49 -0700)
Test Plan:
  $ arc diff # with unsound tests
  $ arc diff --ignore-unsound-tests # with unsound tests

Reviewers: epriestley, aran

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T1515

Differential Revision: https://secure.phabricator.com/D2985

src/workflow/ArcanistDiffWorkflow.php

index c4ab3abf109404640c3a839019d86ffa10208059..278bfbdd0f4dcf955dec9ba22cb82070f01ef9fc 100644 (file)
@@ -342,6 +342,9 @@ EOTEXT
       'skip-binaries' => array(
         'help'  => 'Do not upload binaries (like images).',
       ),
+      'ignore-unsound-tests' => array(
+        'help'  => 'Ignore unsound test failures without prompting.',
+      ),
       'base' => array(
         'param' => 'rules',
         'help'  => 'Additional rules for determining base revision.',
@@ -1296,11 +1299,17 @@ EOTEXT
             "<bg:green>** UNIT OKAY **</bg> No unit test failures.\n");
           break;
         case ArcanistUnitWorkflow::RESULT_UNSOUND:
-          $continue = phutil_console_confirm(
-            "Unit test results included failures, but all failing tests ".
-            "are known to be unsound. Ignore unsound test failures?");
-          if (!$continue) {
-            throw new ArcanistUserAbortException();
+          if ($this->getArgument('ignore-unsound-tests')) {
+            echo phutil_console_format(
+              "<bg:yellow>** UNIT UNSOUND **</bg> Unit testing raised errors, ".
+              "but all failing tests are unsound.\n");
+          } else {
+            $continue = phutil_console_confirm(
+              "Unit test results included failures, but all failing tests ".
+              "are known to be unsound. Ignore unsound test failures?");
+            if (!$continue) {
+              throw new ArcanistUserAbortException();
+            }
           }
           break;
         case ArcanistUnitWorkflow::RESULT_FAIL: