mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Run tests in CI
This commit is contained in:
@ -21,6 +21,20 @@ if [[ ! -z $SYNTAX ]]; then
|
|||||||
EXIT=1
|
EXIT=1
|
||||||
fi
|
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
|
# Show build duration
|
||||||
END=$(date +%s)
|
END=$(date +%s)
|
||||||
echo "$(info) exiting with code $EXIT after $(($END - $START)) seconds."
|
echo "$(info) exiting with code $EXIT after $(($END - $START)) seconds."
|
||||||
|
Reference in New Issue
Block a user