Skip to content

Commit

Permalink
These tests should not need a web server: they are Kernel tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
fgm committed Oct 24, 2015
1 parent 945b178 commit 3bc5a45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# Scrutinizer external coverage parser
ocular.phar

# Composer-generated dependencies, which should not be there anyway.
/vendor/

# Generated coverage
coverage.clover
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ env:
- DRUPAL_VERSION='8.0.x'
- PHPCS_VERSION='2.0.*@dev'
- CODER_VERSION='8.2.0-alpha2'
- PHPUNIT_OPTS="-c core -v --coverage-clover=coverage.clover"
- COVERAGE=coverage.clover
- PHPUNIT_OPTS="-c core -v --coverage-clover=$COVERAGE"


# Code coverage via coveralls.io
#- COVERAGE="satooshi/php-coveralls:0.6.*"
Expand Down Expand Up @@ -88,21 +90,23 @@ before_script:
# Install Drupal and enable the required modules (including this one).
- mysql -e "create database $DB_NAME;"
- drush si -y --db-url="$DB_URL" testing
- if [ ! -z $MODULE_DEPS ]; then drush dl $MODULE_DEPS && drush en -y $MODULE_DS -y ; fi
- if [ ! -z $MODULE_DEPS ]; then drush dl $MODULE_DEPS && drush en -y $MODULE_DEPS -y ; fi
- drush en $MODULE_NAME -y

# Start a web server.
- drush runserver 127.0.0.1:8080 &
- until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done
#- drush runserver 127.0.0.1:8080 &
#- until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done

script:
# Don't run code sniffer: "discourages" sniffs are broken on PHP 5.6.
#- phpcs --report=full --standard=Drupal $TRAVIS_BUILD_DIR/drupal/modules/$MODULE_NAME

# Run the tests
- cd $TRAVIS_BUILD_DIR/drupal
- SIMPLETEST_DB="$DB_URL" vendor/bin/phpunit $PHPUNIT_OPTS modules/contrib/beanstalkd/src/Tests
- SIMPLETEST_DB="$DB_URL" vendor/bin/phpunit $PHPUNIT_OPTS modules/contrib/$MODULE_NAME/src/Tests

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- cd $TRAVIS_BUILD_DIR/drupal/modules/contrib/$MODULE_NAME
- mv ../../../$COVERAGE .
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover $COVERAGE

0 comments on commit 3bc5a45

Please sign in to comment.