Skip to content

Commit 2cd4278

Browse files
committed
add shell script for continuous integration on jenkins
1 parent 87439da commit 2cd4278

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Diff for: ci.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env sh
2+
#
3+
# continuous integration shell script to set up the project and run tests
4+
#
5+
#
6+
# apt-get install python-virtualenv
7+
# sudo apt-get install libxml2-dev libxslt1-dev (needed for pyquery)
8+
# create a virtualenv, preferrably with the python 2.7 variant:
9+
virtualenv env
10+
# update setuptools if neccessary
11+
env/bin/pip install --upgrade pip
12+
env/bin/pip install -U setuptools
13+
# set it up
14+
# this will take a little while and install all necessary dependencies.
15+
env/bin/python setup.py develop
16+
# delete the old database
17+
rm zabo.sqlite
18+
# populate the database
19+
env/bin/initialize_zabo_db development.ini
20+
# prepare for tests
21+
env/bin/pip install nose coverage pep8 pylint pyflakes pyquery
22+
#
23+
# test preparation
24+
#
25+
# we use selenium for user interface tests. so we need firefox and xvfb
26+
# start Xvfband send it to the background: Xvfb :10 &
27+
#export DISPLAY=:10
28+
# run the tests
29+
env/bin/nosetests zabo/ --with-coverage --cover-html --with-xunit
30+
# this is how you can run individial tests:
31+
#env/bin/nosetests zabo/tests/test_webtest.py:FunctionalTests.test_faq_template
32+
33+
# for pyflakes
34+
find zabo -regex '.*.py' ! -regex '.*tests.*'|egrep -v '^./tests/'|xargs env/bin/pyflakes > pyflakes.log || :
35+
# for pylint
36+
rm -f pylint.log
37+
for f in `find zabo -regex '.*.py' ! -regex '.*tests.*'|egrep -v '^./tests/'`; do
38+
env/bin/pylint --output-format=parseable --reports=y $f >> pylint.log
39+
done || :

0 commit comments

Comments
 (0)