forked from DGNum/gestioCOF
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:
parent
f5b23174de
commit
85e593ddb8
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue