diff --git a/.circleci/config.yml b/.circleci/config.yml index 834023395..8cf378908 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: working_directory: ~/normandy environment: - COMPOSE_FILE: ci/docker-compose.yml + COMPOSE_FILE: ci/docker-compose.yml steps: - checkout @@ -57,6 +57,10 @@ jobs: name: Python Tests command: docker-compose run web python-tests + - run: + name: Missing migrations + command: docker-compose run web migrations-check + - run: name: Contract tests command: | diff --git a/bin/run.sh b/bin/run.sh index ef04ebfee..003631364 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -2,7 +2,7 @@ set -eo pipefail usage() { - echo "usage: ./bin/run.sh python-tests|js-tests|lint|start" + echo "usage: ./bin/run.sh python-tests|js-tests|lint|start|migrations-check" exit 1 } @@ -37,6 +37,13 @@ case $1 in fi set -e ;; + migrations-check) + ./manage.py migrate + echo "Checking that all migrations have been made" + ./manage.py makemigrations --check --no-input --dry-run || ( + echo "You probably have migrations that need to be created" && exit 1 + ) + ;; python-tests) echo "Running Python tests" junit_path=$ARTIFACTS_PATH/test_results/python_tests