Permalink
Browse files

trunk in tests + separate reqs

  • Loading branch information...
1 parent ec892a9 commit 0ab21914733ce8af68a68658a7af97d0828c78c5 @fivethreeo committed Sep 5, 2011
Showing with 25 additions and 12 deletions.
  1. +1 −1 cmsplugin_blog/test/run_tests.py
  2. +1 −4 requirements-12.txt
  3. +0 −3 requirements-13.txt
  4. +1 −0 requirements-trunk.txt
  5. +3 −0 requirements.txt
  6. +19 −4 runtests.sh
@@ -15,7 +15,7 @@
'cmsplugin_blog.middleware.MultilingualBlogEntriesMiddleware'
]
-if django.VERSION[1] > 2: # pragma: no cover
+if django.VERSION[1] < 3: # pragma: no cover
MIDDLEWARE_CLASSES.insert(5, 'cbv.middleware.DeferredRenderingMiddleware')
def run_tests():
View
@@ -1,5 +1,2 @@
-django-sekizai
-coverage
Django==1.2.5
-django-cbv
-unittest-xml-reporting==1.2
+django-cbv
View
@@ -1,4 +1 @@
-django-sekizai
-coverage
Django==1.3
-unittest-xml-reporting==1.2
View
@@ -0,0 +1 @@
+-e git+http://github.com/django/django.git#egg=Django
View
@@ -0,0 +1,3 @@
+django-sekizai
+coverage
+unittest-xml-reporting==1.2
View
23 runtests.sh 100755 → 100644
@@ -1,12 +1,15 @@
#!/bin/bash
+find . -name '*.pyc' -delete
+
args=("$@")
num_args=${#args[@]}
index=0
django=12
reuse_env=true
disable_coverage=true
+update_requirements=false
python="python" # to ensure this script works if no python option is specified
while [ "$index" -lt "$num_args" ]
@@ -19,7 +22,11 @@ case "${args[$index]}" in
"-r"|"--rebuild-env")
reuse_env=false
;;
-
+
+ "-u"|"--update-requirements")
+ update_requirements=true
+ ;;
+
"-d"|"--django")
let "index = $index + 1"
django="${args[$index]}"
@@ -40,7 +47,8 @@ case "${args[$index]}" in
echo " runtests.sh"
echo ""
echo "flags:"
- echo " -r, --rebuild-env - run buildout before the tests"
+ echo " -r, --rebuild-env - delete virtualenv and rebuild virtualenv before the tests"
+ echo " -u, --update-requirements - update requirements before the tests"
echo " -d, --django <version> - run tests against a django version, options: 12, 13 or trunk"
echo " -c, --with-coverage - enables coverage"
echo " -p, --python /path/to/python - python version to use to run the tests"
@@ -61,12 +69,19 @@ if [ $reuse_env == false ]; then
rm -rf $venv
echo "deleted virtualenv: $venv"
fi
+
if [ ! -d $venv ]; then
echo "building virtualenv"
virtualenv $venv --distribute -p $python_executeable
- $venv/bin/pip install -r requirements-$django.txt
+ update_requirements=true
else
- echo "reusing current virualenv"
+ echo "reusing current virualenv: $venv"
+fi
+
+if [ $update_requirements == true ]; then
+ echo "updating requirements"
+ $venv/bin/pip install -r requirements-$django.txt
+ $venv/bin/pip install -r requirements.txt
fi
if [ $disable_coverage == false ]; then

0 comments on commit 0ab2191

Please sign in to comment.