private $workingCopy;
private $paths;
private $arguments = array();
+ protected $diffID;
final public function __construct() {
abstract public function run();
+ /**
+ * This function is called after run() when the diff is created
+ * Child classes should override this function if they want to
+ * do more with the diff ID.
+ */
+ public function setDifferentialDiffID($id) {
+ $this->diffID = $id;
+ }
}
private $unresolvedLint;
private $unresolvedTests;
private $diffID;
+ private $unitWorkflow;
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
'differential.creatediff',
$diff);
+ if ($this->unitWorkflow) {
+ $this->unitWorkflow->setDifferentialDiffID($diff_info['diffid']);
+ }
+
if ($this->unresolvedLint) {
$data = array();
foreach ($this->unresolvedLint as $message) {
if ($repository_api instanceof ArcanistSubversionAPI) {
$argv = array_merge($argv, array_keys($paths));
}
- $unit_workflow = $this->buildChildWorkflow('unit', $argv);
- $unit_result = $unit_workflow->run();
+ $this->unitWorkflow = $this->buildChildWorkflow('unit', $argv);
+ $unit_result = $this->unitWorkflow->run();
switch ($unit_result) {
case ArcanistUnitWorkflow::RESULT_OKAY:
echo phutil_console_format(
break;
}
- $this->unresolvedTests = $unit_workflow->getUnresolvedTests();
+ $this->unresolvedTests = $this->unitWorkflow->getUnresolvedTests();
return $unit_result;
} catch (ArcanistNoEngineException $ex) {
const RESULT_SKIP = 3;
private $unresolvedTests;
+ private $engine;
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
PhutilSymbolLoader::loadClass($engine_class);
- $engine = newv($engine_class, array());
- $engine->setWorkingCopy($working_copy);
- $engine->setPaths($paths);
- $engine->setArguments($this->getPassthruArgumentsAsMap('unit'));
+ $this->engine = newv($engine_class, array());
+ $this->engine->setWorkingCopy($working_copy);
+ $this->engine->setPaths($paths);
+ $this->engine->setArguments($this->getPassthruArgumentsAsMap('unit'));
- $results = $engine->run();
+ $results = $this->engine->run();
$status_codes = array(
ArcanistUnitTestResult::RESULT_PASS => phutil_console_format(
return $this->unresolvedTests;
}
+ public function setDifferentialDiffID($id) {
+ if ($this->engine) {
+ $this->engine->setDifferentialDiffID($id);
+ }
+ }
+
}