From ac8638dadd87c3cc9c40a01c15d9c48fc319e8e6 Mon Sep 17 00:00:00 2001 From: Ryan Castner Date: Wed, 5 Jul 2017 09:32:27 -0400 Subject: [PATCH] Chore -- Update testing (#126) * Ignore new testing related files * Add tox testing, coverage and codecov integration. Drop Django 1.9 testing as support officially ended in April, Add Django 1.11 testing, the new LTS version of Django Add testing against Django for each versions supported python versions. Remove Django from requirements, install handled through tox for tests and regular repositories do not need us to install Django for them or enforce a django version, they can choose to use a supported version or not. * Update for python 3.6 tests --- .gitignore | 3 +++ .travis.yml | 40 ++++++++++++++++++++++++++++------------ requirements-test.txt | 5 +++++ requirements.txt | 1 - tox.ini | 20 ++++++++++++++++++++ 5 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 requirements-test.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 54a2bac..e6d60c8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ .idea .project .pydevproject +.coverage +venv/ +.tox/ local_settings.py diff --git a/.travis.yml b/.travis.yml index eba615e..abb3a13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,30 @@ +# Config file for automatic testing at travis-ci.org + +dist: trusty +sudo: required language: python -python: - - "2.7" - - "3.4" +python: 3.6 + env: - - DJANGO_VERSION=1.8.* - - DJANGO_VERSION=1.9.* - - DJANGO_VERSION=1.10.* - - DJANGO_VERSION=1.11a1 -install: - - "pip install -r requirements.txt" - - "pip install Django==$DJANGO_VERSION" -script: "python src/runtests.py" -sudo: false + - TOX_ENV=py36-django-18 + - TOX_ENV=py35-django-18 + - TOX_ENV=py34-django-18 + - TOX_ENV=py27-django-18 + - TOX_ENV=py36-django-110 + - TOX_ENV=py35-django-110 + - TOX_ENV=py34-django-110 + - TOX_ENV=py27-django-110 + - TOX_ENV=py36-django-111 + - TOX_ENV=py35-django-111 + - TOX_ENV=py34-django-111 + - TOX_ENV=py27-django-111 + +matrix: + fast_finish: true + +install: pip install -r requirements-test.txt + +script: tox -e $TOX_ENV + +after_success: + - codecov -e TOX_ENV diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..41a8ec9 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,5 @@ +-r requirements.txt + +coverage==4.3.4 +tox>=1.7.0 +codecov>=2.0.0 diff --git a/requirements.txt b/requirements.txt index 83357f2..30cbe61 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -Django>=1.8 django-jsonfield>=1.0.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..c39cb70 --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +envlist = + {py27,py34,py35,py36}-django-18 + {py27,py34,py35,py36}-django-110 + {py27,py34,py35,py36}-django-111 + +[testenv] +setenv = + PYTHONPATH = {toxinidir}:{toxinidir}/src/auditlog +commands = coverage run --source src/auditlog src/runtests.py +deps = + django-18: Django>=1.8,<1.9 + django-110: Django>=1.10,<1.11 + django-111: Django>=1.11 + -r{toxinidir}/requirements-test.txt +basepython = + py36: python3.6 + py35: python3.5 + py34: python3.4 + py27: python2.7