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