Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ cache:
- $HOME/tmp/drush
- $HOME/.bundle
- $HOME/.composer
- $HOME/downloads
apt: true

git:
depth: 10000

php:
- 5.5
- 5.6
- 7.0
- 5.6
- 5.5

# This creates a build with each php environment. 6 builds in total.
env:
Expand Down Expand Up @@ -63,15 +64,20 @@ install:
- composer require drupal/facets:1.x-dev
- composer require drush/drush
#########################################
# to be removed once #2803701 is resolved
- cd modules/search_api
- curl https://www.drupal.org/files/issues/2803701-8--php5_strict_warning.patch | patch -p1
- cd $TRAVIS_BUILD_DIR/../drupal
# to be removed once #2817399 is resolved
- cd modules/facets
- curl https://www.drupal.org/files/issues/fix_block_delete_tests-2817399-11.patch | patch -p1
#########################################
# to be removed once https://github.com/drush-ops/drush/pull/2420 is approved
- cd $TRAVIS_BUILD_DIR/../drupal/vendor/drush/drush
- curl https://gist.githubusercontent.com/itsekhmistro/30ced918a45de48a3543e6fc5d0d3098/raw/ed2da17268507ca12909f0ff684a38fccef7b259/d8-rs-router.fix-q.patch | patch -p1
#########################################
- cd $TRAVIS_BUILD_DIR/../drupal

before_script:
# start the built-in php web server (mysql is already started)
- php -S localhost:8888 &
# Start the built-in php web server (mysql is already started) and
# suppress web-server access logs output.
- php -S localhost:8888 ./vendor/drush/drush/commands/runserver/d8-rs-router.php >& /dev/null &
# Install the site
- ./vendor/bin/drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes
- ./vendor/bin/drush en --yes simpletest
Expand All @@ -95,23 +101,23 @@ script:
- export SIMPLETEST_DB=mysql://root:@localhost/drupal
- export SIMPLETEST_BASE_URL=http://localhost:8888
- php core/scripts/run-tests.sh --verbose --color --non-html --concurrency 8 --php `which php` --url http://localhost:8888 --directory modules --types Simpletest | tee /tmp/test.txt | grep passes; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT
# Check if we had fails in the run-tests.sh script
# Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\
# is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a
# bit.
# Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors.
- TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(Fatal erro)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$?
- cd $TRAVIS_BUILD_DIR/../drupal
- ./vendor/bin/phpunit -c core --group search_api,facets,search_api_solr,search_api_solr_multilingual --verbose | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT
#- ./vendor/bin/phpunit --group search_api_solr_multilingual -c "../modules/search_api_solr/phpunit.xml.travis" --verbose --debug --coverage-text | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT
# if the TEST_EXIT status is 0 AND the TEST_OUTPUT status is also 0 it means we succeeded, in all other cases we
# failed.
# Re-enable when trying to get CodeSniffer doesn't return a 403 anymore.
#- /home/travis/.composer/vendor/bin/phpcs --standard=/home/travis/.composer/vendor/drupal/coder/coder_sniffer/Drupal --extensions=php,inc,test,module,install --ignore=css/ $TRAVIS_BUILD_DIR/../drupal/modules/search_api_multilingual
- php -i | grep 'php.ini'
#- php -i | grep 'php.ini'
# Check if we had fails in the run-tests.sh script
# Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\
# is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a
# bit.
# Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors.
- TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(Fatal erro)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$?
# Exit the build
- echo $TEST_EXIT
- echo $TEST_OUTPUT
- echo $TEST_PHPUNIT
- if [ $TEST_OUTPUT -eq 1 ]; then echo /tmp/test.txt; fi
- if [ $TEST_EXIT -ne 0 ]; then cat /tmp/test.txt; fi
- if [ $TEST_EXIT -eq 0 ] && [ $TEST_OUTPUT -eq 0 ] && [ $TEST_PHPUNIT -eq 0 ]; then exit 0; else exit 1; fi