Don't clobber any settings_local.py in the ietf directory while running tests -- create a temporary one in the test directory instead.
- Legacy-Id: 449
This commit is contained in:
parent
fe83e207ae
commit
8896ddb085
2
test/run
2
test/run
|
@ -13,7 +13,7 @@ test/run-pyflakes ietf
|
||||||
trap 'echo "$program($LINENO): Caught Interrupt"' INT
|
trap 'echo "$program($LINENO): Caught Interrupt"' INT
|
||||||
|
|
||||||
# run tests with our patched django
|
# run tests with our patched django
|
||||||
PYTHONPATH=test/lib python ietf/manage.py test
|
PYTHONPATH=test:test/lib python ietf/manage.py test
|
||||||
|
|
||||||
# reset keyboard interrupt trap
|
# reset keyboard interrupt trap
|
||||||
trap INT
|
trap INT
|
||||||
|
|
|
@ -49,7 +49,7 @@ cd $build
|
||||||
settings_local=$(py_module_file "settings_local")
|
settings_local=$(py_module_file "settings_local")
|
||||||
[ "$settings_local" ] || die "No setting_local file available"
|
[ "$settings_local" ] || die "No setting_local file available"
|
||||||
|
|
||||||
cat $settings_local test/settings_local_test.py > ietf/settings_local.py
|
cat $settings_local test/settings_local_test.py > test/settings_local.py
|
||||||
|
|
||||||
# Acquire lock, to prevent running test and database update at the same time
|
# Acquire lock, to prevent running test and database update at the same time
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@ PIDFILE=$LOCKDIR/pid
|
||||||
while true; do
|
while true; do
|
||||||
if mkdir $LOCKDIR; then
|
if mkdir $LOCKDIR; then
|
||||||
echo "$$" > $PIDFILE
|
echo "$$" > $PIDFILE
|
||||||
chmod a+xr $LOCKDIR
|
chmod a+rwx $LOCKDIR
|
||||||
chmod a+r $PIDFILE
|
chmod a+rw $PIDFILE
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
pid=$(< $PIDFILE )
|
pid=$(< $PIDFILE )
|
||||||
|
|
|
@ -12,6 +12,11 @@ build=$PWD
|
||||||
|
|
||||||
. $progdir/shell-utils
|
. $progdir/shell-utils
|
||||||
|
|
||||||
|
# Project teardown
|
||||||
|
# Remove the temporary settings_local.py we created for the tests
|
||||||
|
|
||||||
|
rm -v test/settings_local.py
|
||||||
|
|
||||||
# Database Cleanup
|
# Database Cleanup
|
||||||
# Make sure the test database has been removed
|
# Make sure the test database has been removed
|
||||||
if echo "show databases;" | python ietf/manage.py dbshell | grep test_ietf; then
|
if echo "show databases;" | python ietf/manage.py dbshell | grep test_ietf; then
|
||||||
|
|
Loading…
Reference in a new issue