Merge pull request #5732 from nextcloud/stable10-fix-drone

[stable10] fix drone for 0.7
This commit is contained in:
Morris Jobke 2017-07-16 11:11:23 +02:00 committed by GitHub
commit 32d6c24dde
3 changed files with 45 additions and 1 deletions

View File

@ -214,28 +214,41 @@ matrix:
- TESTS: carddavtester-old-endpoint
- DB: NODB
PHP: 5.4
ENABLE_REDIS: true
- DB: NODB
PHP: 5.5
ENABLE_REDIS: true
- DB: NODB
PHP: 5.6
ENABLE_REDIS: true
- DB: NODB
PHP: 7.0
ENABLE_REDIS: true
- DB: sqlite
PHP: 5.4
ENABLE_REDIS: true
- DB: sqlite
PHP: 5.5
ENABLE_REDIS: true
- DB: sqlite
PHP: 5.6
ENABLE_REDIS: true
- DB: sqlite
PHP: 7.0
ENABLE_REDIS: true
- DB: mysql
PHP: 5.6
ENABLE_REDIS: true
- DB: postgres
PHP: 5.6
ENABLE_REDIS: true
services:
cache:
image: redis
when:
matrix:
ENABLE_REDIS: true
postgres:
image: postgres
environment:

View File

@ -143,6 +143,10 @@ function cleanup_config {
if [ -f config/autotest-storage-swift.config.php ]; then
rm config/autotest-storage-swift.config.php
fi
# Remove autotest redis config
if [ -f config/redis.config.php ]; then
rm config/redis.config.php
fi
}
# restore config on exit
@ -176,6 +180,10 @@ function execute_tests {
fi
cp tests/preseed-config.php config/config.php
if [ "$ENABLE_REDIS" == "true" ] ; then
cp tests/redis.config.php config/redis.config.php
fi
_DB=$DB
# drop database
@ -200,7 +208,7 @@ function execute_tests {
fi
mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
else
DATABASEHOST=127.0.0.1
DATABASEHOST=mysql
fi
fi
echo "Waiting for MySQL initialisation ..."
@ -254,6 +262,17 @@ function execute_tests {
echo "Postgres is up."
else
if [ ! -z "$DRONE" ] ; then
DATABASEHOST=postgres
fi
echo "Waiting for Postgres to be available ..."
if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 5432 60; then
echo "[ERROR] Waited 60 seconds, no response" >&2
exit 1
fi
echo "Give it 10 additional seconds ..."
sleep 10
if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
dropdb -U "$DATABASEUSER" "$DATABASENAME" || true
fi

12
tests/redis.config.php Normal file
View File

@ -0,0 +1,12 @@
<?php
$CONFIG = [
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => [
'host' => 'cache',
'port' => 6379,
'timeout' => 0,
],
];