From aabe7e62b038d1100990e2eaa859d3af7daf15f3 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 14 Jul 2018 10:36:23 +0200 Subject: [PATCH] jenkins: use tox.ini to run tests --- jenkins.sh | 8 +++----- tox.ini | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 tox.ini diff --git a/jenkins.sh b/jenkins.sh index ec93da8..0962b83 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -1,9 +1,7 @@ #!/bin/sh pip install --upgrade setuptools -pip install --upgrade 'pip<8' -pip install --editable . -pip install --upgrade 'pylint<1.8' 'pylint-django<0.9' pytest pytest-cov pytest-django pytest-mock 'django<2' django-webtest httmock -pip install --upgrade WebTest==2.0.16 +pip install --upgrade pip +pip install tox -DJANGO_SETTINGS_MODULE=welco.settings py.test --junitxml=test_results.xml --cov-report xml --cov=welco/ tests/ +tox -r diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..fb717aa --- /dev/null +++ b/tox.ini @@ -0,0 +1,29 @@ +[tox] +envlist = coverage-{django18,django111} +toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/welco/ + +[testenv] +usedevelop = + coverage: True +setenv = + DJANGO_SETTINGS_MODULE=welco.settings + PASSERELLE_SETTINGS_FILE=tests/settings.py + fast: FAST=--nomigrations + coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=welco/ +deps = + django18: django>=1.8,<1.9 + django111: django>=1.11,<1.12 + pytest-cov + pytest-django + pytest + WebTest + mock + httmock + python-dateutil + pylint<1.8 + pylint-django<0.9 + django-webtest + pyquery + lxml +commands = + py.test {env:FAST:} {env:COVERAGE:} {posargs:tests/}