mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-54059 testing: Simplify travis output
This commit is contained in:
parent
2c952b2f38
commit
a24aff4edf
1 changed files with 44 additions and 39 deletions
83
.travis.yml
83
.travis.yml
|
@ -27,16 +27,16 @@ env:
|
||||||
# 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
|
# Run unit tests on MySQL
|
||||||
- DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
- DB=mysqli TASK=PHPUNIT
|
||||||
|
|
||||||
# Run CI Tests without running PHPUnit.
|
# Run CI Tests without running PHPUnit.
|
||||||
- DB=none PHPUNIT=false INSTALL=false CITEST=true
|
- DB=none TASK=CITEST
|
||||||
|
|
||||||
# Run unit tests on Postgres
|
# Run unit tests on Postgres
|
||||||
- DB=pgsql PHPUNIT=true INSTALL=false CITEST=false
|
- DB=pgsql TASK=PHPUNIT
|
||||||
|
|
||||||
# Perform an upgrade test too.
|
# Perform an upgrade test too.
|
||||||
- DB=pgsql PHPUNIT=false INSTALL=true CITEST=false UPGRADE=true
|
- DB=pgsql TASK=UPGRADE
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
# Enable fast finish.
|
# Enable fast finish.
|
||||||
|
@ -47,17 +47,17 @@ matrix:
|
||||||
exclude:
|
exclude:
|
||||||
# MySQL - it's just too slow.
|
# MySQL - it's just too slow.
|
||||||
# Exclude it on all versions except for 7.0
|
# Exclude it on all versions except for 7.0
|
||||||
# - env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
# - env: DB=mysqli TASK=PHPUNIT
|
||||||
# php: 5.6
|
# php: 5.6
|
||||||
#
|
#
|
||||||
# - env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
# - env: DB=mysqli TASK=PHPUNIT
|
||||||
# php: 5.5
|
# php: 5.5
|
||||||
|
|
||||||
- env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
- env: DB=mysqli TASK=PHPUNIT
|
||||||
php: 5.4
|
php: 5.4
|
||||||
|
|
||||||
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
|
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
|
||||||
- env: DB=pgsql PHPUNIT=false INSTALL=true CITEST=false UPGRADE=true
|
- env: DB=pgsql TASK=UPGRADE
|
||||||
php: 7.0
|
php: 7.0
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
|
@ -70,6 +70,7 @@ install:
|
||||||
|
|
||||||
# Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
|
# Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
|
||||||
- if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
|
- if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
|
||||||
|
- echo 'auth.json' >> .git/info/exclude
|
||||||
|
|
||||||
# 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.
|
||||||
|
@ -78,7 +79,7 @@ install:
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- >
|
- >
|
||||||
if [ "$INSTALL" = 'true' -o "$PHPUNIT" = 'true' ];
|
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
|
||||||
then
|
then
|
||||||
# Copy generic configuration in place.
|
# Copy generic configuration in place.
|
||||||
cp config-dist.php config.php ;
|
cp config-dist.php config.php ;
|
||||||
|
@ -120,38 +121,29 @@ before_script:
|
||||||
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
|
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
|
||||||
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;' ;
|
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;' ;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PHPUNIT" = 'true' ];
|
|
||||||
then
|
|
||||||
# Create a directory for the phpunit dataroot.
|
|
||||||
mkdir -p "$HOME"/roots/phpunit
|
|
||||||
|
|
||||||
# The phpunit dataroot and prefix..
|
|
||||||
sed -i \
|
|
||||||
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
|
|
||||||
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
|
|
||||||
config.php ;
|
|
||||||
|
|
||||||
# Initialise PHPUnit for Moodle.
|
|
||||||
php admin/tool/phpunit/cli/init.php
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
script:
|
|
||||||
########################################################################
|
|
||||||
# PHPUnit
|
|
||||||
########################################################################
|
|
||||||
- >
|
- >
|
||||||
if [ "$PHPUNIT" = 'true' ];
|
if [ "$TASK" = 'PHPUNIT' ];
|
||||||
then
|
then
|
||||||
vendor/bin/phpunit;
|
# Create a directory for the phpunit dataroot.
|
||||||
|
mkdir -p "$HOME"/roots/phpunit
|
||||||
|
|
||||||
|
# The phpunit dataroot and prefix..
|
||||||
|
sed -i \
|
||||||
|
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
|
||||||
|
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
|
||||||
|
config.php ;
|
||||||
|
|
||||||
|
# Initialise PHPUnit for Moodle.
|
||||||
|
php admin/tool/phpunit/cli/init.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# CI Tests
|
# CI Tests
|
||||||
########################################################################
|
########################################################################
|
||||||
- >
|
- >
|
||||||
if [ "$CITEST" = 'true' ];
|
if [ "$TASK" = 'CITEST' ];
|
||||||
then
|
then
|
||||||
# Note - this is deliberately placed in the script section as we
|
# Note - this is deliberately placed in the script section as we
|
||||||
# should not add any code until after phpunit has run.
|
# should not add any code until after phpunit has run.
|
||||||
|
@ -174,18 +166,11 @@ script:
|
||||||
export phpcmd=`which php`;
|
export phpcmd=`which php`;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Actually run the CI Tests - do this outside of the main test to make output clearer.
|
|
||||||
- >
|
|
||||||
if [ "$CITEST" = 'true' ];
|
|
||||||
then
|
|
||||||
bash local/ci/php_lint/php_lint.sh;
|
|
||||||
fi
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Upgrade test
|
# Upgrade test
|
||||||
########################################################################
|
########################################################################
|
||||||
- >
|
- >
|
||||||
if [ "$UPGRADE" = 'true' ];
|
if [ "$TASK" = 'UPGRADE' ];
|
||||||
then
|
then
|
||||||
# We need the official upstream.
|
# We need the official upstream.
|
||||||
git remote add upstream https://github.com/moodle/moodle.git;
|
git remote add upstream https://github.com/moodle/moodle.git;
|
||||||
|
@ -205,7 +190,27 @@ script:
|
||||||
|
|
||||||
# The local_ci repository can be used to check upgrade savepoints.
|
# The local_ci repository can be used to check upgrade savepoints.
|
||||||
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
|
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
|
||||||
|
fi
|
||||||
|
|
||||||
|
script:
|
||||||
|
- >
|
||||||
|
if [ "$TASK" = 'PHPUNIT' ];
|
||||||
|
then
|
||||||
|
vendor/bin/phpunit;
|
||||||
|
fi
|
||||||
|
|
||||||
|
- >
|
||||||
|
if [ "$TASK" = 'CITEST' ];
|
||||||
|
then
|
||||||
|
bash local/ci/php_lint/php_lint.sh;
|
||||||
|
fi
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Upgrade test
|
||||||
|
########################################################################
|
||||||
|
- >
|
||||||
|
if [ "$TASK" = 'UPGRADE' ];
|
||||||
|
then
|
||||||
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
|
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
|
||||||
result=`php check_upgrade_savepoints.php`;
|
result=`php check_upgrade_savepoints.php`;
|
||||||
# Check if there are problems
|
# Check if there are problems
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue