Moved CHEF_CONF_FOLDER to extrasettings.
For testing purposes, set CHEF_CONF_FOLDER to base nailgun dir. node_id.json is created during tests. To clean unused files use './run_tests.sh -c' since now.
This commit is contained in:
parent
163b782f9d
commit
f66db19840
|
@ -7,6 +7,7 @@
|
|||
# services' runtime files
|
||||
*.log
|
||||
*.pid
|
||||
*.json
|
||||
|
||||
# Vagrant housekeeping file
|
||||
/.vagrant
|
||||
|
|
|
@ -6,6 +6,7 @@ LOGFILE = os.path.join(LOGPATH, "nailgun.log")
|
|||
LOGLEVEL = "<%= @loglevel %>"
|
||||
CELERYLOGFILE = os.path.join(LOGPATH, "celery.log")
|
||||
CELERYLOGLEVEL = "<%= @loglevel %>"
|
||||
CHEF_CONF_FOLDER = "/var/www"
|
||||
|
||||
PATH_TO_SSH_KEY = "<%= @sshkey %>"
|
||||
PATH_TO_BOOTSTRAP_SSH_KEY = "<%= @bootstrap_sshkey %>"
|
||||
|
@ -13,4 +14,4 @@ PATH_TO_BOOTSTRAP_SSH_KEY = "<%= @bootstrap_sshkey %>"
|
|||
COBBLER_URL = "http://<%= @cobbler_address %>/cobbler_api"
|
||||
COBBLER_USER = "<%= @cobbler_user %>"
|
||||
COBBLER_PASSWORD = "<%= @cobbler_password %>"
|
||||
COBBLER_PROFILE = "<%= @cobbler_profile %>"
|
||||
COBBLER_PROFILE = "<%= @cobbler_profile %>"
|
||||
|
|
|
@ -6,6 +6,7 @@ LOGFILE = os.path.join(LOGPATH, "nailgun.log")
|
|||
LOGLEVEL = "DEBUG"
|
||||
CELERYLOGFILE = os.path.join(LOGPATH, "celery.log")
|
||||
CELERYLOGLEVEL = "DEBUG"
|
||||
CHEF_CONF_FOLDER = LOGPATH # For testing purposes
|
||||
|
||||
PATH_TO_SSH_KEY = os.path.join(os.getenv("HOME"), ".ssh", "id_rsa")
|
||||
PATH_TO_BOOTSTRAP_SSH_KEY = os.path.join(os.getenv("HOME"),
|
||||
|
|
|
@ -164,7 +164,6 @@ CELERY_IMPORTS = ("nailgun.tasks",)
|
|||
CELERY_DISABLE_RATE_LIMITS = True
|
||||
CELERY_EAGER_PROPAGATES_EXCEPTIONS = False
|
||||
|
||||
CHEF_CONF_FOLDER = "/var/www"
|
||||
CHEF_NODES_DATABAG_NAME = "nodes"
|
||||
|
||||
PISTON_IGNORE_DUPE_MODELS = True
|
||||
|
|
|
@ -7,6 +7,7 @@ function usage {
|
|||
echo " -p, --pep8 Just run PEP8 and HACKING compliance check"
|
||||
echo " -x, --xunit Generate reports (useful in Jenkins environment)"
|
||||
echo " -P, --no-pep8 Don't run static code checks"
|
||||
echo " -c, --clean Only clean *.log, *.json, *.pyc, *.pid files, doesn't run tests"
|
||||
echo " -h, --help Print this usage message"
|
||||
echo ""
|
||||
echo "By default it runs tests and pep8 check."
|
||||
|
@ -19,6 +20,7 @@ function process_option {
|
|||
-p|--pep8) just_pep8=1;;
|
||||
-P|--no-pep8) no_pep8=1;;
|
||||
-x|--xunit) xunit=1;;
|
||||
-c|--clean) clean=1;;
|
||||
-*) noseopts="$noseopts $1";;
|
||||
*) noseargs="$noseargs $1"
|
||||
esac
|
||||
|
@ -27,6 +29,7 @@ function process_option {
|
|||
just_pep8=0
|
||||
no_pep8=0
|
||||
xunit=0
|
||||
clean=0
|
||||
noseargs=
|
||||
noseopts=
|
||||
|
||||
|
@ -34,6 +37,19 @@ for arg in "$@"; do
|
|||
process_option $arg
|
||||
done
|
||||
|
||||
function clean {
|
||||
echo "cleaning *.pyc, *.json, *.log, *.pid files"
|
||||
find . -type f -name "*.pyc" -delete
|
||||
rm -f *.json
|
||||
rm -f *.log
|
||||
rm -f *.pid
|
||||
}
|
||||
|
||||
if [ $clean -eq 1 ]; then
|
||||
clean
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# If enabled, tell nose to create xunit report
|
||||
if [ $xunit -eq 1 ]; then
|
||||
noseopts="--with-xunit"
|
||||
|
@ -50,9 +66,7 @@ if [ $just_pep8 -eq 1 ]; then
|
|||
fi
|
||||
|
||||
function run_tests {
|
||||
# Cleanup *pyc
|
||||
echo "cleaning *.pyc files"
|
||||
find . -type f -name "*.pyc" -delete
|
||||
clean
|
||||
python manage.py test nailgun $noseopts $noseargs
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue