Skip to content

Commit

Permalink
Add coveralls for phpunit, and behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmackay committed Feb 8, 2016
1 parent 3c0ac97 commit 3112e5f
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: coverage/*
json_path: coverage/coveralls.json
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ before_script:
script:
- "./bin/tests run --no-install"
- "composer lint"
after_success:
# - travis_retry bin/coveralls
# or enable logging
- travis_retry bin/coveralls -v
before_deploy:
- bin/release ${TRAVIS_TAG:-$TRAVIS_COMMIT}
deploy:
Expand Down
9 changes: 7 additions & 2 deletions bin/tests
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ abstract class UshahidiTestsCommand extends Command
{
if ($state === 'up' && !$this->test_server_pid)
{
$command = "php -S localhost:8000 -t {$this->dir}"
. " {$this->dir}/httpdocs/index.php"
$command = "php -S localhost:8000 -t {$this->dir}/httpdocs"
. " {$this->dir}/httpdocs/coverage.php"
. " > /dev/null 2>&1 & echo $!;"
;

Expand Down Expand Up @@ -196,6 +196,9 @@ class UshahidiTestsRunCommand extends UshahidiTestsCommand
$no_install = $input->getOption('no-install');
if (!$no_install) { $this->install(); }

$coverage_dir = $this->dir . 'coverage';
system('rm -rf ' . escapeshellarg($coverage_dir) . '/*'); // clear coverage

// start the local test server
$this->testServer('up');

Expand Down Expand Up @@ -235,6 +238,8 @@ class UshahidiTestsRunCommand extends UshahidiTestsCommand

$elapsed_time = time() - $test_start_time;

system('rm -rf ' . escapeshellarg($coverage_dir) . '/*'); // clear coverage

// output a single pass/fail message
if ($tests_pass)
{
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"league/event": "^2.2@dev",
"league/url": "~3.0",
"beheh/flaps": "dev-master",
"doctrine/cache": "^1.5@dev"
"doctrine/cache": "^1.5@dev",
"satooshi/php-coveralls": "^2.0@dev"
},
"require-dev": {
"behat/behat": "~2.5.2",
Expand All @@ -57,7 +58,8 @@
"phpspec/phpspec": "~2.1.0",
"symfony/console": "2.6.*",
"squizlabs/php_codesniffer": "1.5.*",
"heroku/heroku-buildpack-php": "dev-master"
"heroku/heroku-buildpack-php": "dev-master",
"ext-xdebug": "*"
},
"minimum-stability": "dev",
"config": {
Expand Down
Loading

0 comments on commit 3112e5f

Please sign in to comment.