Skip to content

Commit

Permalink
MDL-53228 testing: Attempt an upgrade from 27
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 24, 2016
1 parent 83a9510 commit 95b3ad6
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ env:
# Run unit tests on Postgres
- DB=pgsql PHPUNIT=true INSTALL=false CITEST=false

# Perform an upgrade test too.
- DB=pgsql PHPUNIT=false INSTALL=true CITEST=false UPGRADE=true

matrix:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
Expand All @@ -53,6 +56,10 @@ matrix:
- env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
php: 5.4

# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
- env: DB=pgsql PHPUNIT=false INSTALL=true CITEST=false UPGRADE=true
php: 7.0

cache:
directories:
- $HOME/.composer/cache
Expand Down Expand Up @@ -173,3 +180,39 @@ script:
then
bash local/ci/php_lint/php_lint.sh;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$UPGRADE" = 'true' ];
then
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
# Checkout 27 STABLE branch.
git fetch upstream MOODLE_27_STABLE;
git checkout MOODLE_27_STABLE;
# Perform the upgrade
php admin/cli/install_database.php --agree-license --adminpass=Password [email protected] --fullname="Upgrade test" --shortname=Upgrade;
# Return to the previous commit
git checkout -;
# Perform the upgrade
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
# The local_ci repository can be used to check upgrade savepoints.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
result=`php check_upgrade_savepoints.php`;
# Check if there are problems
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
if (($count > 0));
then
echo "$result"
exit 1 ;
fi
fi

0 comments on commit 95b3ad6

Please sign in to comment.