Skip to content

Commit

Permalink
Allow unittests to be skipped when releasing package
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jun 7, 2014
1 parent 38d4a7e commit 5fc57e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions components/lib/Components/Module/Release.php
Expand Up @@ -170,6 +170,7 @@ public function getHelp($action)
The available tasks are:
- unittest : Perform unittests on the package.
- timestamp : Timestamp the package.xml and sync the change log.
- composer : Update the composer.json file.
- sentinel : Update the sentinels in docs/CHANGES and lib/Application.php.
Expand Down
26 changes: 14 additions & 12 deletions components/lib/Components/Runner/Release.php
Expand Up @@ -85,19 +85,21 @@ public function run()

$pre_commit = false;

/* Require package unit tests to pass locally before committing. */
$unit = $this->_qc->getTask('unit', $component);
if (!$unit->validate($options)) {
$this->_output->info(
'Running ' . $unit->getName() . ' on ' . $component->getName() . "\n"
);

if ($unit->run($options)) {
$this->_output->warn('Aborting due to unit test errors.');
return;
if ($this->_doTask('unittest')) {
$unit = $this->_qc->getTask('unit', $component);
if (!$unit->validate($options)) {
$this->_output->info(
'Running ' . $unit->getName() . ' on ' . $component->getName() . "\n"
);

if ($unit->run($options)) {
$this->_output->warn('Aborting due to unit test errors.');
return;
}

$this->_output->ok('No problems found in unit test.');
}

$this->_output->ok('No problems found in unit test.');
$pre_commit = true;
}

if ($this->_doTask('timestamp')) {
Expand Down

0 comments on commit 5fc57e0

Please sign in to comment.