mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-64530 travis: Enabble PHP 7.3 and redis cache
This commit performs a number of changes: - Enables PHP 7.3, replacing PHP 7.2 (max/min approach). - Enables back the redis service - Configures redis cache store tests to be run. - Disables redis session tests for PHP 7.2 and up (MDL-60978)
This commit is contained in:
parent
a866c5c238
commit
a8b2f03d8b
1 changed files with 19 additions and 21 deletions
40
.travis.yml
40
.travis.yml
|
@ -13,7 +13,7 @@ language: php
|
||||||
|
|
||||||
php:
|
php:
|
||||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
||||||
- 7.2
|
- 7.3
|
||||||
- 7.1
|
- 7.1
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
|
@ -23,10 +23,6 @@ addons:
|
||||||
- mysql-client-core-5.6
|
- mysql-client-core-5.6
|
||||||
- mysql-client-5.6
|
- mysql-client-5.6
|
||||||
|
|
||||||
# Redis tests are currently failing on php 7.2 due to https://bugs.php.net/bug.php?id=75628
|
|
||||||
# services:
|
|
||||||
# - redis-server
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
||||||
# start first so that the total run time is not too high.
|
# start first so that the total run time is not too high.
|
||||||
|
@ -35,9 +31,6 @@ env:
|
||||||
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
||||||
# Postgres is significantly is pretty reasonable in its run-time.
|
# Postgres is significantly is pretty reasonable in its run-time.
|
||||||
|
|
||||||
# Run unit tests on MySQL
|
|
||||||
- DB=mysqli TASK=PHPUNIT
|
|
||||||
|
|
||||||
# Run CI Tests without running PHPUnit.
|
# Run CI Tests without running PHPUnit.
|
||||||
- DB=none TASK=CITEST
|
- DB=none TASK=CITEST
|
||||||
|
|
||||||
|
@ -54,22 +47,22 @@ matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
# Run mysql only on 7.3 - it's just too slow
|
||||||
|
- php: 7.3
|
||||||
|
env: DB=mysqli TASK=PHPUNIT
|
||||||
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
||||||
- php: 7.2
|
- php: 7.2
|
||||||
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
|
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
|
||||||
|
|
||||||
exclude:
|
|
||||||
# MySQL - it's just too slow.
|
|
||||||
# Exclude it on all versions except for 7.2
|
|
||||||
|
|
||||||
- env: DB=mysqli TASK=PHPUNIT
|
|
||||||
php: 7.1
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.composer/cache
|
- $HOME/.composer/cache
|
||||||
- $HOME/.npm
|
- $HOME/.npm
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
# Avoid IPv6 default binding as service (causes redis not to start).
|
||||||
|
sudo service redis-server start --bind 127.0.0.1
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- >
|
- >
|
||||||
if [ "$DB" = 'mysqli' ];
|
if [ "$DB" = 'mysqli' ];
|
||||||
|
@ -99,10 +92,8 @@ install:
|
||||||
echo 'auth.json' >> .git/info/exclude
|
echo 'auth.json' >> .git/info/exclude
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable Redis.
|
echo 'extension="redis.so"' > /tmp/redis.ini
|
||||||
# Redis tests are currently failing on php 7.2 due to https://bugs.php.net/bug.php?id=75628
|
phpenv config-add /tmp/redis.ini
|
||||||
# echo 'extension="redis.so"' > /tmp/redis.ini
|
|
||||||
# phpenv config-add /tmp/redis.ini
|
|
||||||
|
|
||||||
# Install composer dependencies.
|
# Install composer dependencies.
|
||||||
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
|
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
|
||||||
|
@ -173,12 +164,19 @@ before_script:
|
||||||
mkdir -p "$HOME"/roots/phpunit
|
mkdir -p "$HOME"/roots/phpunit
|
||||||
|
|
||||||
# The phpunit dataroot and prefix..
|
# The phpunit dataroot and prefix..
|
||||||
# Redis tests are currently failing on php 7.2 due to https://bugs.php.net/bug.php?id=75628
|
|
||||||
# -e "/require_once/i \\define('TEST_SESSION_REDIS_HOST', '127.0.0.1');" \
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
|
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
|
||||||
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
|
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
|
||||||
config.php ;
|
config.php ;
|
||||||
|
# Redis cache store tests
|
||||||
|
sed -i \
|
||||||
|
-e "/require_once/i \\define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1');" \
|
||||||
|
config.php ;
|
||||||
|
# Redis session tests, but not for PHP 7.2 and up. See MDL-60978 for more info.
|
||||||
|
redissession="if (version_compare(PHP_VERSION, '7.2.0', '<')) { define('TEST_SESSION_REDIS_HOST', '127.0.0.1'); }"
|
||||||
|
sed -i \
|
||||||
|
-e "/require_once/i \\${redissession}" \
|
||||||
|
config.php ;
|
||||||
|
|
||||||
# Initialise PHPUnit for Moodle.
|
# Initialise PHPUnit for Moodle.
|
||||||
php admin/tool/phpunit/cli/init.php
|
php admin/tool/phpunit/cli/init.php
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue