Skip to content

Commit

Permalink
Merge branch '1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
vidarl committed Oct 26, 2018
2 parents 1e681db + d111132 commit 9f94ef6
Show file tree
Hide file tree
Showing 15 changed files with 1,475 additions and 283 deletions.
25 changes: 24 additions & 1 deletion .travis.yml
@@ -1,5 +1,17 @@
language: php

services:
- mysql
- postgresql

# Mysql isn't installed on trusty (only client is), so we need to specifically install it
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6

matrix:
include:
- php: 5.6
Expand All @@ -14,12 +26,23 @@ matrix:
env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="4.10.4" CORES_SETUP="single" SOLR_CORES="collection1" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml"
- php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="6.6.0" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml"
- php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
- php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy-empty-db.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"
- php: 7.0
env: TEST_CONFIG="phpunit.xml" COMPOSER_REQUIRE="ezsystems/ezpublish-kernel:^6.13.6@dev"

# test only master (+ Pull requests)
branches:
only:
- master


# setup requirements for running db tests
before_install:
- if [ "$TEST_CONFIG" != "" ] ; then ./bin/.travis/prepare_unittest.sh ; fi

before_script:
# Disable memory_limit for composer
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
Expand All @@ -30,7 +53,7 @@ before_script:

script:
- php vendor/bin/phpunit --bootstrap tests/bootstrap.php -c $TEST_CONFIG
- if [ "$CHECK_CS" == "true" ]; then phpenv config-rm xdebug.ini && ./vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi
- if [ "$CHECK_CS" == "true" ]; then ./vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi

notifications:
email: false
29 changes: 29 additions & 0 deletions bin/.travis/prepare_unittest.sh
@@ -0,0 +1,29 @@
#!/bin/sh

# File for setting up system for unit/integration testing

# Disable xdebug to speed things up as we don't currently generate coverge on travis
# And make sure we use UTF-8 encoding
phpenv config-rm xdebug.ini
echo "default_charset = UTF-8" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

# Setup DB
if [ "$DB" = "mysql" ] ; then
# https://github.com/travis-ci/travis-ci/issues/3049
# make sure we don't run out of entropy apparently (see link above)
sudo apt-get -y install haveged
sudo service haveged start
# make tmpfs and run MySQL on it for reasonable performance
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo stop mysql
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
sudo start mysql
# Install test db
mysql -e "CREATE DATABASE IF NOT EXISTS testdb DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" -uroot
fi
if [ "$DB" = "postgresql" ] ; then psql -c "CREATE DATABASE testdb;" -U postgres ; psql -c "CREATE EXTENSION pgcrypto;" -U postgres testdb ; fi

if [ "$COMPOSER_REQUIRE" != "" ] ; then composer require --no-update $COMPOSER_REQUIRE ; fi
#travis_retry composer update --no-progress --no-interaction $COMPSER_ARGS

0 comments on commit 9f94ef6

Please sign in to comment.