mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Establish a separate configuration file for testing
This commit is contained in:
parent
0432b1a6f9
commit
f316958943
36
netbox/netbox/configuration.testing.py
Normal file
36
netbox/netbox/configuration.testing.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
###################################################################
|
||||||
|
# This file serves as a base configuration for testing purposes #
|
||||||
|
# only. It is not intended for production use. #
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
|
DATABASE = {
|
||||||
|
'NAME': 'netbox',
|
||||||
|
'USER': '',
|
||||||
|
'PASSWORD': '',
|
||||||
|
'HOST': 'localhost',
|
||||||
|
'PORT': '',
|
||||||
|
'CONN_MAX_AGE': 300,
|
||||||
|
}
|
||||||
|
|
||||||
|
REDIS = {
|
||||||
|
'tasks': {
|
||||||
|
'HOST': 'localhost',
|
||||||
|
'PORT': 6379,
|
||||||
|
'PASSWORD': '',
|
||||||
|
'DATABASE': 0,
|
||||||
|
'DEFAULT_TIMEOUT': 300,
|
||||||
|
'SSL': False,
|
||||||
|
},
|
||||||
|
'caching': {
|
||||||
|
'HOST': 'localhost',
|
||||||
|
'PORT': 6379,
|
||||||
|
'PASSWORD': '',
|
||||||
|
'DATABASE': 1,
|
||||||
|
'DEFAULT_TIMEOUT': 300,
|
||||||
|
'SSL': False,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SECRET_KEY = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
@ -34,11 +34,9 @@ if [[ $RC != 0 ]]; then
|
|||||||
EXIT=$RC
|
EXIT=$RC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare configuration file for use in CI
|
# Point to the testing configuration file for use in CI
|
||||||
CONFIG="netbox/netbox/configuration.py"
|
CONFIG="netbox/netbox/configuration.py"
|
||||||
cp netbox/netbox/configuration.example.py $CONFIG
|
ln -s netbox/netbox/configuration.testing.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
|
# Run NetBox tests
|
||||||
coverage run --source="netbox/" netbox/manage.py test netbox/
|
coverage run --source="netbox/" netbox/manage.py test netbox/
|
||||||
|
Loading…
Reference in New Issue
Block a user