Projet

Général

Profil

0001-Added-tox-as-a-test-runner.patch

Nickolas Grigoriadis, 22 novembre 2014 06:28

Télécharger (4,34 ko)

Voir les différences:

Subject: [PATCH] Added tox as a test-runner.

It will build different virtualenvs for each target.
getlasso.sh is somewhat hacky, but until lasso is installable through pip this is the workaround.

License: MIT
 .gitignore       |  4 +++-
 MANIFEST.in      |  2 ++
 getlasso.sh      | 20 ++++++++++++++++++++
 requirements.txt |  2 +-
 setup.py         |  2 +-
 test_settings    | 34 ++++++++++++++++++++++++++++++++++
 tox.ini          | 25 +++++++++++++++++++++++++
 7 files changed, 86 insertions(+), 3 deletions(-)
 create mode 100755 getlasso.sh
 create mode 100644 test_settings
 create mode 100644 tox.ini
.gitignore
13 13
authentic2/locale/fr/LC_MESSAGES/django.mo
14 14
local_settings.*
15 15
*.egg-info
16
*.mo
16
*.mo
17
.tox
18

  
MANIFEST.in
44 44
include ez_setup.py
45 45
include authentic2/auth2_auth/auth2_ssl/authentic_ssl.vhost
46 46
include requirements.txt
47
include test_settings
48
include getlasso.sh
47 49
include authentic2/vendor/dpam/LICENSE
48 50
include authentic2/nonce/README.rst
49 51
include doc/conf.py doc/Makefile doc/README.rst.bak 
getlasso.sh
1
#!/bin/sh
2

  
3
# Get venv site-packages path
4
DSTDIR=`python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
5

  
6
# Get not venv site-packages path
7
# Remove first path (assuming that is the venv path)
8
NONPATH=`echo $PATH | sed 's/^[^:]*://'`
9
SRCDIR=`PATH=$NONPATH python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
10

  
11
# Clean up
12
rm -f $DSTDIR/lasso.*
13
rm -f $DSTDIR/_lasso.*
14

  
15
# Link
16
ln -sv $SRCDIR/lasso.py $DSTDIR
17
ln -sv $SRCDIR/_lasso.* $DSTDIR
18

  
19
exit 0
20

  
requirements.txt
1
Django<1.6
1
Django>1.5,<1.7
2 2
south>=0.8.4
3 3
requests
4 4
django-model-utils
setup.py
113 113
      scripts = ('authentic2-ctl',),
114 114
      packages=find_packages(),
115 115
      include_package_data=True,
116
      install_requires=['django < 1.6',
116
      install_requires=['django >= 1.5, < 1.7',
117 117
        'south>=0.8.4',
118 118
        'requests',
119 119
        'django-model-utils',
test_settings
1
import os.path
2

  
3
DEBUG = False
4

  
5
if DEBUG:
6
	DEBUG_TOOLBAR = True
7
	TEMPLATE_DEBUG = True
8
	DEBUG_TOOLBAR_CONFIG = {
9
			'INTERCEPT_REDIRECTS': False,
10
	}
11
INTERNAL_IPS = ('127.0.0.1',)
12

  
13
SECRET_KEY = 'coin'
14

  
15
from authentic2.settings import INSTALLED_APPS, \
16
     MIDDLEWARE_CLASSES
17

  
18
DATABASES = {
19
    'default': {
20
        'ENGINE': 'django.db.backends.sqlite3',
21
        'NAME': os.path.join(os.path.dirname(__file__), 'authentic2.sqlite'),
22
    },
23
}
24

  
25
if DEBUG:
26
	INSTALLED_APPS += ('debug_toolbar',)
27
	MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
28

  
29

  
30
LANGUAGE_CODE = 'en'
31

  
32
IDP_SAML2 = True
33
#IDP_OPENID = True
34

  
tox.ini
1
# Tox (http://tox.testrun.org/) is a tool for running tests
2
# in multiple virtualenvs. This configuration file will run the
3
# test suite on all supported python versions. To use it, "pip install tox"
4
# and then run "tox" from this directory.
5

  
6
[tox]
7
envlist = django15, django16
8

  
9
[testenv:django15]
10
commands =
11
    ./getlasso.sh
12
    ln -sf test_settings local_settings.py
13
    ./authentic2-ctl test auth contenttypes sessions messages admin_tools theming menu dashboard authentic2
14
deps = django>1.5,<1.6
15

  
16
[testenv:django16]
17
commands =
18
    ./getlasso.sh
19
    ln -sf test_settings local_settings.py
20
    ./authentic2-ctl test django.contrib.auth django.contrib.contenttypes django.contrib.sessions django.contrib.messages admin_tools authentic2
21
deps = django>1.6,<1.7
22

  
23

  
24

  
25

  
0
-