jenkins: switch to tox for running tests (#15974)
parent
8818a38827
commit
70a99cadd0
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get venv site-packages path
|
||||
DSTDIR=`python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
|
||||
|
||||
# Get not venv site-packages path
|
||||
# Remove first path (assuming that is the venv path)
|
||||
NONPATH=`echo $PATH | sed 's/^[^:]*://'`
|
||||
SRCDIR=`PATH=$NONPATH python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
|
||||
|
||||
# Clean up
|
||||
rm -f $DSTDIR/lasso.*
|
||||
rm -f $DSTDIR/_lasso.*
|
||||
|
||||
# Link
|
||||
ln -sv $SRCDIR/lasso.py $DSTDIR
|
||||
ln -sv $SRCDIR/_lasso.* $DSTDIR
|
||||
|
||||
exit 0
|
||||
|
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e -x
|
||||
env
|
||||
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
|
||||
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
|
||||
elif [ -f pylint.django.rc ]; then
|
||||
PYLINT_RC=pylint.django.rc
|
||||
else
|
||||
echo No pylint RC found
|
||||
exit 0
|
||||
fi
|
||||
|
||||
test -f pylint.out && cp pylint.out pylint.out.prev
|
||||
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
|
||||
test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true
|
@ -0,0 +1,30 @@
|
||||
[tox]
|
||||
envlist = coverage-django18-pylint,coverage-django111
|
||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/chrono/
|
||||
|
||||
[testenv]
|
||||
usedevelop =
|
||||
coverage: True
|
||||
nocoverage: False
|
||||
setenv =
|
||||
DJANGO_SETTINGS_MODULE=chrono.settings
|
||||
CHRONO_SETTINGS_FILE=tests/settings.py
|
||||
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=chrono/
|
||||
deps =
|
||||
django18: django>=1.8,<1.9
|
||||
django111: django>=1.11,<1.12
|
||||
pytest-cov
|
||||
pytest-django
|
||||
pytest
|
||||
pytest-capturelog
|
||||
WebTest
|
||||
mock
|
||||
httmock
|
||||
pylint
|
||||
pylint-django
|
||||
django-webtest
|
||||
django-mellon
|
||||
commands =
|
||||
./getlasso.sh
|
||||
py.test {env:COVERAGE:} {posargs:tests/}
|
||||
pylint: ./pylint.sh chrono/
|
Loading…
Reference in New Issue