]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Let TestEngine know if the command that triggered tests is 'arc diff' or 'arc
authortuomaspelkonen <tuomaspelkonen@fb.com>
Fri, 10 Jun 2011 19:40:01 +0000 (12:40 -0700)
committertuomaspelkonen <tuomaspelkonen@fb.com>
Fri, 10 Jun 2011 20:00:03 +0000 (13:00 -0700)
unit'

Summary:
We want to handle 'arc unit' and 'arc diff' differently in our test
framework.

Test Plan:
Tested that with 'arc unit' the value was set to 'unit' and with 'arc diff'
the value was set to 'diff'.

Reviewed By: epriestley
Reviewers: slawekbiel, epriestley
CC: jungejason, grglr, aran, tuomaspelkonen, epriestley
Differential Revision: 430

src/unit/engine/base/ArcanistBaseUnitTestEngine.php
src/workflow/unit/ArcanistUnitWorkflow.php

index b635827421dab1f348018cce38780b5e8c644ce2..0668f61d37cb3e893f66cd4019d70b17d6e93763 100644 (file)
@@ -27,6 +27,7 @@ abstract class ArcanistBaseUnitTestEngine {
   private $paths;
   private $arguments = array();
   protected $diffID;
+  private $enableAsyncTests;
 
   final public function __construct() {
 
@@ -61,6 +62,14 @@ abstract class ArcanistBaseUnitTestEngine {
     return idx($this->arguments, $key, $default);
   }
 
+  final public function setEnableAsyncTests($enable_async_tests) {
+    $this->enableAsyncTests = $enable_async_tests;
+  }
+
+  final public function getEnableAsyncTests() {
+    return $this->enableAsyncTests;
+  }
+
   abstract public function run();
 
   /**
index cc92c61625fae154fb01896d0ec3da732f02c493..cc16239ad943ba15acc444c14443c30c50934a43 100644 (file)
@@ -99,6 +99,13 @@ EOTEXT
     $this->engine->setPaths($paths);
     $this->engine->setArguments($this->getPassthruArgumentsAsMap('unit'));
 
+    // Enable possible async tests only for 'arc diff' not 'arc unit'
+    if ($this->getParentWorkflow()) {
+      $this->engine->setEnableAsyncTests(true);
+    } else {
+      $this->engine->setEnableAsyncTests(false);
+    }
+
     $results = $this->engine->run();
 
     $status_codes = array(