From c5d498ac148a0c41b1864804e37a9023e5d2fcfc Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Mon, 27 Jun 2016 16:58:00 -0400 Subject: [PATCH] Run tests in CI --- scripts/cibuild.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/cibuild.sh b/scripts/cibuild.sh index 91a847c37..b3f50152e 100755 --- a/scripts/cibuild.sh +++ b/scripts/cibuild.sh @@ -21,6 +21,20 @@ if [[ ! -z $SYNTAX ]]; then EXIT=1 fi +# Prepare configuration file for use in CI +CONFIG="netbox/netbox/configuration.py" +cp netbox/netbox/configuration.example.py $CONFIG +sed -i -e "s/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = \['*'\]/g" $CONFIG +sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = 'netboxci'/g" $CONFIG + +# Run NetBox tests +./netbox/manage.py test netbox/ +RC=$? +if [[ $RC != 0 ]]; then + echo -e "\n$(info) one or more tests failed, failing build." + EXIT=$RC +fi + # Show build duration END=$(date +%s) echo "$(info) exiting with code $EXIT after $(($END - $START)) seconds."