mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
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
This commit is contained in:
parent
dcc76bb58b
commit
42c6f00315
2 changed files with 16 additions and 0 deletions
|
@ -27,6 +27,7 @@ abstract class ArcanistBaseUnitTestEngine {
|
||||||
private $paths;
|
private $paths;
|
||||||
private $arguments = array();
|
private $arguments = array();
|
||||||
protected $diffID;
|
protected $diffID;
|
||||||
|
private $enableAsyncTests;
|
||||||
|
|
||||||
final public function __construct() {
|
final public function __construct() {
|
||||||
|
|
||||||
|
@ -61,6 +62,14 @@ abstract class ArcanistBaseUnitTestEngine {
|
||||||
return idx($this->arguments, $key, $default);
|
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();
|
abstract public function run();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,6 +99,13 @@ EOTEXT
|
||||||
$this->engine->setPaths($paths);
|
$this->engine->setPaths($paths);
|
||||||
$this->engine->setArguments($this->getPassthruArgumentsAsMap('unit'));
|
$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();
|
$results = $this->engine->run();
|
||||||
|
|
||||||
$status_codes = array(
|
$status_codes = array(
|
||||||
|
|
Loading…
Reference in a new issue