Skip to content

Commit 833f1bc

Browse files
author
Percy
committed
tweaked build
1 parent f95706d commit 833f1bc

File tree

7 files changed

+40
-83
lines changed

7 files changed

+40
-83
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ dist/*
88
example.db
99

1010
jenkins_reports/*
11+
.coverage
12+
coverage.xml
13+
nosetests.xml

ci.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# verify user provided a name for the virtualenv
4+
if [ -z "$1" ]; then
5+
echo "usage: $0 virtual_env_name"
6+
exit
7+
fi
8+
9+
VIRTUALENV_NAME=$1
10+
11+
virtualenv $VIRTUALENV_NAME
12+
. $VIRTUALENV_NAME/bin/activate
13+
14+
find . -name "*.pyc" -delete
15+
python setup.py install_dev
16+
17+
python example/manage.py test --with-xunit --with-xcover --cover-package=dynamic_rules
18+
TEST_EXIT=$?
19+
rm -rf jenkins_reports
20+
mkdir jenkins_reports
21+
pep8 dynamic_rules > jenkins_reports/pep8.report
22+
PEP8_EXIT=$?
23+
pyflakes dynamic_rules > jenkins_reports/pyflakes.report
24+
PYFLAKES_EXIT=$?
25+
let JENKINS_EXIT="$TEST_EXIT + $PEP8_EXIT + $PYFLAKES_EXIT"
26+
if [ $JENKINS_EXIT -gt 2 ]; then
27+
echo "Test exit status:" $TEST_EXIT
28+
echo "PEP8 exit status:" $PEP8_EXIT
29+
echo "Pyflakes exit status:" $PYFLAKES_EXIT
30+
echo "Exiting Build with status:" $EXIT
31+
exit $JENKINS_EXIT
32+
fi

dynamic_rules/tests/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
2-
from dynamic_rules.tests.test_registry import *
3-
from dynamic_rules.tests.test_admin_forms import *
4-
from dynamic_rules.tests.test_models import *
5-
from dynamic_rules.tests.test_dynamic_actions import *
6-
from dynamic_rules.tests.test_ext import *

example/settings.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,14 @@
3838

3939
'dynamic_rules',
4040
'sample',
41+
'django_nose',
4142
)
4243

44+
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
45+
4346
try:
4447
import south
4548
INSTALLED_APPS = ('south', ) + INSTALLED_APPS
4649
SOUTH_TESTS_MIGRATE = False
4750
except ImportError:
4851
pass
49-
50-
try:
51-
import django_jenkins
52-
PROJECT_APPS = [app for app in INSTALLED_APPS if not app.startswith('django.contrib')]
53-
54-
INSTALLED_APPS = INSTALLED_APPS + ('django_jenkins',)
55-
JENKINS_TASKS = (
56-
'django_jenkins.tasks.django_tests',
57-
'django_jenkins.tasks.run_pylint',
58-
'django_jenkins.tasks.run_pep8',
59-
'django_jenkins.tasks.run_pyflakes',
60-
'django_jenkins.tasks.with_coverage',
61-
)
62-
63-
except ImportError:
64-
pass

run_jenkins.sh

-29
This file was deleted.

runtests.py

-31
This file was deleted.

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
TEST_REQUIREMENTS = [
1515
'mock',
16-
'django-jenkins',
1716
'pep8',
1817
'pyflakes',
18+
'django_nose',
19+
'nosexcover',
1920
]
2021

2122
def do_setup():

0 commit comments

Comments
 (0)