From 85d55cc06dce054593c8d9dcb7c9e86cfaa4d412 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 5 Oct 2015 18:05:45 +0200 Subject: [PATCH 8/8] add a jenkins script (#8425) --- jenkins.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 jenkins.sh diff --git a/jenkins.sh b/jenkins.sh new file mode 100755 index 0000000..aba2b9a --- /dev/null +++ b/jenkins.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +rm -f *coverage.xml +rm -f *test_results.xml + +export PIP_USE_WHEEL=no +pip install --upgrade pip +pip install --upgrade pylint==1.4.0 astroid==1.3.2 # 1.4.1 is buggy +pip install --upgrade pytest pytest-django pytest-cov +pip install --upgrade django-tenant-schemas +pip install --upgrade -r requirements.txt + +DJANGO_SETTINGS_MODULE=hobo.settings \ +HOBO_SETTINGS_FILE=tests/settings.py \ +py.test --junitxml=hobo_server_test_results.xml --cov-report xml --cov=hobo/ --cov-config .coveragerc tests/ +mv coverage.xml hobo_server_coverage.xml + +(cd tests_multitenant ; PYTHONPATH=. DJANGO_SETTINGS_MODULE=settings py.test --junitxml=../multitenant_test_results.xml --cov-report xml --cov=../hobo/ --cov-config .coveragerc .) +mv tests_multitenant/coverage.xml multitenant_coverage.xml +./merge-junit-results.py hobo_server_test_results.xml multitenant_test_results.xml >test_results.xml +./merge-coverage.py -o coverage.xml *_coverage.xml + +test -f pylint.out && cp pylint.out pylint.out.prev +(pylint -f parseable --rcfile /var/lib/jenkins/pylint.django.rc hobo | tee pylint.out) || /bin/true +test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true -- 2.1.4