[Nostromo] Test coverage

This commit is contained in:
Andrés Montañez 2017-01-10 21:48:38 -03:00
parent 3a1a1b1ac2
commit 2c567bebff

View file

@ -116,7 +116,7 @@ class DeployCommand extends AbstractCommand
// Run "Pre Deploy" Tasks // Run "Pre Deploy" Tasks
$this->runtime->setStage(Runtime::PRE_DEPLOY); $this->runtime->setStage(Runtime::PRE_DEPLOY);
if (!$this->runTasks($output, $strategy->getPreDeployTasks())) { if (!$this->runTasks($output, $strategy->getPreDeployTasks())) {
$this->halt(); throw $this->getException();
} }
// Run "On Deploy" Tasks // Run "On Deploy" Tasks
@ -134,7 +134,7 @@ class DeployCommand extends AbstractCommand
// Run "Post Deploy" Tasks // Run "Post Deploy" Tasks
$this->runtime->setStage(Runtime::POST_DEPLOY); $this->runtime->setStage(Runtime::POST_DEPLOY);
if (!$this->runTasks($output, $strategy->getPostDeployTasks())) { if (!$this->runTasks($output, $strategy->getPostDeployTasks())) {
$this->halt(); throw $this->getException();
} }
} }
@ -149,7 +149,7 @@ class DeployCommand extends AbstractCommand
$this->runtime->setWorkingHost($host); $this->runtime->setWorkingHost($host);
if (!$this->runTasks($output, $tasks)) { if (!$this->runTasks($output, $tasks)) {
$this->runtime->setWorkingHost(null); $this->runtime->setWorkingHost(null);
$this->halt(); throw $this->getException();
} }
$this->runtime->setWorkingHost(null); $this->runtime->setWorkingHost(null);
} }
@ -231,12 +231,10 @@ class DeployCommand extends AbstractCommand
} }
/** /**
* Halts the current process * Exception for halting the the current process
*
* @throws RuntimeException
*/ */
protected function halt() protected function getException()
{ {
throw new RuntimeException(sprintf('Stage "%s" did not finished successfully, halting command.', $this->getStageName()), 50); return new RuntimeException(sprintf('Stage "%s" did not finished successfully, halting command.', $this->getStageName()), 50);
} }
} }