From e604b3239d1c5e51a2e2fbda1a52557962b79b78 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 20 Apr 2019 18:11:24 +0200 Subject: [PATCH] fix travis tests --- .travis.yml | 10 +++++++--- .travis/apcu.ini | 4 ++++ .travis/memcached.ini | 1 + .travis/redis.ini | 1 + tests/src/Core/Lock/APCuCacheLockDriverTest.php | 9 +++++++++ 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .travis/apcu.ini create mode 100644 .travis/memcached.ini create mode 100644 .travis/redis.ini diff --git a/.travis.yml b/.travis.yml index a241dff0f..e2aa84f5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,11 @@ before_script: - cp config/local-sample.config.php config/local.config.php - mysql -e 'CREATE DATABASE IF NOT EXISTS test;' - mysql -utravis test < database.sql - - echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "apc.enable_cli = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - pecl channel-update pecl.php.net + - pecl config-set preferred_state beta + - if [[ $TRAVIS_PHP_VERSION != "7.1" ]]; then echo yes | pecl upgrade apcu; fi + - if [[ $TRAVIS_PHP_VERSION != "7.1" ]]; then phpenv config-add .travis/apcu.ini; fi + - phpenv config-add .travis/redis.ini + - phpenv config-add .travis/memcached.ini + after_success: bash <(curl -s https://codecov.io/bash) diff --git a/.travis/apcu.ini b/.travis/apcu.ini new file mode 100644 index 000000000..92598662c --- /dev/null +++ b/.travis/apcu.ini @@ -0,0 +1,4 @@ +extension="apcu.so" + +apc.enabled = 1 +apc.enable_cli = 1 \ No newline at end of file diff --git a/.travis/memcached.ini b/.travis/memcached.ini new file mode 100644 index 000000000..c9a2ff0c9 --- /dev/null +++ b/.travis/memcached.ini @@ -0,0 +1 @@ +extension="memcached.so" \ No newline at end of file diff --git a/.travis/redis.ini b/.travis/redis.ini new file mode 100644 index 000000000..ab995b837 --- /dev/null +++ b/.travis/redis.ini @@ -0,0 +1 @@ +extension="redis.so" \ No newline at end of file diff --git a/tests/src/Core/Lock/APCuCacheLockDriverTest.php b/tests/src/Core/Lock/APCuCacheLockDriverTest.php index 7b0137e36..6e185d6b9 100644 --- a/tests/src/Core/Lock/APCuCacheLockDriverTest.php +++ b/tests/src/Core/Lock/APCuCacheLockDriverTest.php @@ -8,6 +8,15 @@ use Friendica\Core\Lock\CacheLockDriver; class APCuCacheLockDriverTest extends LockTest { + protected function setUp() + { + if (!APCuCache::isAvailable()) { + $this->markTestSkipped('APCu is not available'); + } + + parent::setUp(); + } + protected function getInstance() { return new CacheLockDriver(new APCuCache());