travis: Test whether migrations are consistent with models.

This should automatically catch mistakes where someone updates the
database models but forgets to generate migrations afterwards.
This commit is contained in:
Tim Abbott 2016-01-09 20:15:19 -08:00
parent 5ef57a07e1
commit 24fd3bbf55
3 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,7 @@ function run {
run ./tools/clean-repo run ./tools/clean-repo
run ./tools/lint-all run ./tools/lint-all
run ./tools/test-migrations
run ./tools/test-js-with-node run ./tools/test-js-with-node
run ./tools/test-backend run ./tools/test-backend
run ./tools/test-js-with-casper run ./tools/test-js-with-casper

10
tools/test-migrations Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
echo 'Testing whether migrations are consistent with models'
if ./manage.py makemigrations -e --dry-run; then
echo
echo 'ERROR: Migrations are not consistent with models! Fix with `./manage.py makemigrations`.'
echo
else
echo "Success! Migrations are consistent with models."
fi

View File

@ -6,3 +6,4 @@ export PATH=$PATH:/srv/zulip-venv/bin
./tools/lint-all ./tools/lint-all
./tools/test-backend ./tools/test-backend
./tools/test-management ./tools/test-management
./tools/test-migrations