Skip to content

Commit

Permalink
Add noRebuild() method for Codeception run command (consolidation#603)
Browse files Browse the repository at this point in the history
This feature is critical for parallel running. Without this, codeception
rebuilds some generated files in each sub-process. This affects to
concurrent writing to the same files the same content. Run fails.
  • Loading branch information
maxgorovenko authored and greg-1-anderson committed Jul 14, 2017
1 parent 4aeb0e7 commit a8919ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Task/Testing/Codecept.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ public function debug()
return $this;
}

/**
* @return $this
*/
public function noRebuild()
{
$this->option("no-rebuild");
return $this;
}

/**
* {@inheritdoc}
*/
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/Task/CodeceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ public function testCodeceptOptions()
->configFile('~/Codeception')
->xml('result.xml')
->html()
->noRebuild()
->getCommand()
)->equals('codecept run tests/unit/Codeception -c ~/Codeception --xml result.xml --html');
)->equals('codecept run tests/unit/Codeception -c ~/Codeception --xml result.xml --html --no-rebuild');

verify((new \Robo\Task\Testing\Codecept('codecept.phar'))->debug()->getCommand())->contains(' --debug');
verify((new \Robo\Task\Testing\Codecept('codecept.phar'))->silent()->getCommand())->contains(' --silent');
verify((new \Robo\Task\Testing\Codecept('codecept.phar'))->excludeGroup('g')->getCommand())->contains(' --skip-group g');
verify((new \Robo\Task\Testing\Codecept('codecept.phar'))->tap()->getCommand())->contains('--tap');
verify((new \Robo\Task\Testing\Codecept('codecept.phar'))->json()->getCommand())->contains('--json');
verify((new \Robo\Task\Testing\Codecept('codecept.phar'))->noRebuild()->getCommand())->contains('--no-rebuild');
}

}

0 comments on commit a8919ef

Please sign in to comment.