Removes the test database if the build fails

Sometime the test database is not destroyed because the build is
interrupted by an uncaught error. This causes an error during the next
build.
This commit is contained in:
Martin Pépin 2017-02-13 17:22:15 +01:00
parent f5b23174de
commit 85e593ddb8

View file

@ -38,3 +38,12 @@ test:
stage: test
script:
- python manage.py test
cleanup:
stage: cleanup
script:
# If an uncaught error occurs, the test database has to be destroyed
# manually
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DBHOST"
-e "DROP DATABASE test_$DBNAME" || true
when: on_failure