From 42c6f003151f342904e6b5a3e24b244c30036b74 Mon Sep 17 00:00:00 2001 From: tuomaspelkonen Date: Fri, 10 Jun 2011 12:40:01 -0700 Subject: [PATCH] Let TestEngine know if the command that triggered tests is 'arc diff' or 'arc 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 | 9 +++++++++ src/workflow/unit/ArcanistUnitWorkflow.php | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/src/unit/engine/base/ArcanistBaseUnitTestEngine.php b/src/unit/engine/base/ArcanistBaseUnitTestEngine.php index b6358274..0668f61d 100644 --- a/src/unit/engine/base/ArcanistBaseUnitTestEngine.php +++ b/src/unit/engine/base/ArcanistBaseUnitTestEngine.php @@ -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(); /** diff --git a/src/workflow/unit/ArcanistUnitWorkflow.php b/src/workflow/unit/ArcanistUnitWorkflow.php index cc92c616..cc16239a 100644 --- a/src/workflow/unit/ArcanistUnitWorkflow.php +++ b/src/workflow/unit/ArcanistUnitWorkflow.php @@ -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( -- 2.43.0