Skip to content

Commit

Permalink
Added option to delay tests execution after phiremock starts
Browse files Browse the repository at this point in the history
  • Loading branch information
mcustiel committed Apr 7, 2016
1 parent 6578351 commit ee08315
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 2,934 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,17 @@ extensions:
bin_path: ../vendor/bin # defaults to codeception_dir/../vendor/bin
logs_path: /var/log/my_app/tests/logs # defaults to codeception's tests output dir
debug: true # defaults to false
startDelay: 1 # default to 0
```
## Parameters
* **listen:** Specifies the interface and port where phiremock must listen for requests
* **bin_path:** Path where Phiremock "binary" is located
* **logs_path:** Path where to write the output
* **debug:** Where to write debug data to log files
* **startDelay:** Time to wait after Phiremock was started to start running the tests (used to give time to Phiremock to boot)
### Module
The module allows you to connect to a Phiremock server and to interact with it in a semantic way through the codeception actor in your tests.
Expand Down
6 changes: 5 additions & 1 deletion src/Extension/Phiremock.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Phiremock extends CodeceptionExtension

protected $config = [
'listen' => '0.0.0.0:8086',
'debug' => false
'debug' => false,
'startDelay' => 0
];

/**
Expand Down Expand Up @@ -66,6 +67,9 @@ public function __construct(
$this->config['logs_path'],
$this->config['debug']
);
if ($this->config['startDelay']) {
sleep($this->config['startDelay']);
}
}

private function initProcess($process)
Expand Down
2 changes: 1 addition & 1 deletion src/Extension/PhiremockProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PhiremockProcess
*
* @var string
*/
const LOG_FILE_NAME = 'phiremock.out';
const LOG_FILE_NAME = 'phiremock.log';

/**
* @var resource
Expand Down
1 change: 1 addition & 0 deletions tests/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ extensions:
config:
\Codeception\Extension\Phiremock:
listen: 0.0.0.0:18080
startDelay: 1

Empty file added tests/tests/_output/.gitignore
Empty file.
3 changes: 0 additions & 3 deletions tests/tests/_output/phiremock.out

This file was deleted.

Empty file.
Loading

0 comments on commit ee08315

Please sign in to comment.