Explorar el Código

Update travis to run the tests via tox

master
Michael van Tellingen hace 8 años
padre
commit
8fbebd0620
Se han modificado 3 ficheros con 93 adiciones y 47 borrados
  1. 1
    0
      .gitignore
  2. 62
    42
      .travis.yml
  3. 30
    5
      tox.ini

+ 1
- 0
.gitignore Ver fichero

29
 
29
 
30
 # Test files
30
 # Test files
31
 .coverage
31
 .coverage
32
+.coverage\.*
32
 .noseids
33
 .noseids
33
 coverage.xml
34
 coverage.xml
34
 violations.txt
35
 violations.txt

+ 62
- 42
.travis.yml Ver fichero

1
-# Use the newer container-based infrastructure
2
-# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
3
 sudo: false
1
 sudo: false
4
-
5
 language: python
2
 language: python
6
 
3
 
7
-python:
8
-    - 2.7
9
-    - 3.3
10
-    - 3.4
11
-    - 3.5
4
+matrix:
5
+  include:
6
+    - python: 2.7
7
+      env: TOXENV=py27-django18
8
+    - python: 2.7
9
+      env: TOXENV=py27-django19
10
+    - python: 2.7
11
+      env: TOXENV=py27-django110
12
+    - python: 3.3
13
+      env: TOXENV=py33-django18
14
+    - python: 3.4
15
+      env: TOXENV=py34-django18
16
+    - python: 3.4
17
+      env: TOXENV=py34-django19
18
+    - python: 3.4
19
+      env: TOXENV=py34-django110
20
+    - python: 3.5
21
+      env: TOXENV=py35-django18
22
+    - python: 3.5
23
+      env: TOXENV=py35-django19
24
+    - python: 3.5
25
+      env: TOXENV=py35-django110
26
+    - python: 3.6
27
+      env: TOXENV=py36-django18
28
+    - python: 3.6
29
+      env: TOXENV=py36-django19
30
+    - python: 3.6
31
+      env: TOXENV=py36-django110
32
+
33
+    - python: 3.5
34
+      env: TOXENV=lint
35
+    - python: 3.5
36
+      env: TOXENV=sandbox
37
+
38
+  allow_failures:
39
+    - python: 3.5
40
+      env: TOXENV=lint
41
+
12
 
42
 
13
 env:
43
 env:
14
-    global:
15
-        # $TRANSIFEX_PASSWORD for oscar_bot (used in transifex.sh)
16
-        - secure: FuIlzEsGJiAwhaIRBmRNsq9eXmuzs25fX6BChknW4lDyVAySWMp0+Zps9Bd0JgfFYUG3Ip+OTmksYIoTUsG25ZJS9cq1IFt3QKUAN70YCI/4ZBLeIdICPEyxq+Km179+NeEXmBUug17RLMLxh3MWfO+RKUHK9yHIPNNpq0dNyoo=
17
-
18
-        # These two environment variables could be set by Travis itself, or Travis
19
-        # could configure itself in /etc/, ~/, or inside of the virtual
20
-        # environments. In any case if these two values get configured then end
21
-        # users only need to enable the pip cache and manually run pip wheel before
22
-        # running pip install.
23
-        - PIP_WHEEL_DIR=$HOME/.cache/pip/wheels
24
-        - PIP_FIND_LINKS=file://$HOME/.cache/pip/wheels
25
-    matrix:
26
-        - DJANGO=Django==1.8.13
27
-        - DJANGO=Django==1.9.7
28
-        - DJANGO=Django==1.10.4
44
+  global:
45
+    # $TRANSIFEX_PASSWORD for oscar_bot (used in transifex.sh)
46
+    - secure: FuIlzEsGJiAwhaIRBmRNsq9eXmuzs25fX6BChknW4lDyVAySWMp0+Zps9Bd0JgfFYUG3Ip+OTmksYIoTUsG25ZJS9cq1IFt3QKUAN70YCI/4ZBLeIdICPEyxq+Km179+NeEXmBUug17RLMLxh3MWfO+RKUHK9yHIPNNpq0dNyoo=
29
 
47
 
48
+    # These two environment variables could be set by Travis itself, or Travis
49
+    # could configure itself in /etc/, ~/, or inside of the virtual
50
+    # environments. In any case if these two values get configured then end
51
+    # users only need to enable the pip cache and manually run pip wheel before
52
+    # running pip install.
53
+    - PIP_WHEEL_DIR=$HOME/.cache/pip/wheels
54
+    - PIP_FIND_LINKS=file://$HOME/.cache/pip/wheels
55
+
56
+
57
+before_cache:
58
+  - rm -rf $HOME/.cache/pip/log
30
 
59
 
31
-matrix:
32
-    exclude:
33
-        # Python 3.3 is not supported by Django 1.9
34
-        - python: 3.3
35
-          env: "DJANGO=Django==1.9.7"
36
-        - python: 3.3
37
-          env: "DJANGO=Django==1.10.4"
38
 
60
 
39
-before_install:
40
-    - pip install codecov
61
+cache:
62
+  directories:
63
+    - $HOME/.cache/pip
64
+
41
 
65
 
42
 install:
66
 install:
43
-    - pip install --pre $DJANGO
44
-    - pip install -r requirements.txt
45
-    - pip list
67
+  - pip install tox codecov
46
 
68
 
47
-before_script:
48
-    # Create testing databases for running migrations against
49
-    - mysql -e 'CREATE DATABASE oscar_travis;'
50
-    - psql -c 'CREATE DATABASE oscar_travis;' -U postgres
51
 
69
 
52
 script:
70
 script:
53
-    - make travis
71
+  - tox
72
+
54
 
73
 
55
 after_success:
74
 after_success:
56
-    - codecov
57
-    - ./transifex.sh
75
+  - tox -e coverage-report
76
+  - codecov
77
+  - ./transifex.sh

+ 30
- 5
tox.ini Ver fichero

1
 [tox]
1
 [tox]
2
-envlist = {py27,py33,py34,py35}-{1.8,1.9}
2
+envlist = py{27,34,35,36}-django{18,19,110},py33-django18,lint,sandbox
3
 
3
 
4
 [testenv]
4
 [testenv]
5
+commands = coverage run --parallel -m pytest {posargs}
6
+extras = test
7
+deps = 
8
+    -r{toxinidir}/requirements.txt
9
+    django18: django>=1.8,<1.9
10
+    django19: django>=1.9,<1.10
11
+    django110: django>=1.10,<1.11
12
+
13
+[testenv:coverage-report]
14
+basepython = python3.5
15
+deps = coverage
16
+skip_install = true
5
 commands =
17
 commands =
6
-    pip install -e .[test]
7
-    python runtests.py
18
+    coverage combine
19
+    coverage report
20
+
21
+
22
+[testenv:lint]
23
+basepython = python3.5
24
+deps = flake8
25
+commands = 
26
+    flake8 src tests setup.py
27
+    isort -q --recursive --diff src/ tests/
28
+
29
+
30
+[testenv:sandbox]
31
+basepython = python3.5
8
 deps = 
32
 deps = 
9
     -r{toxinidir}/requirements.txt
33
     -r{toxinidir}/requirements.txt
10
-    1.8: django==1.8.13
11
-    1.9: django==1.9.7
34
+    django>=1.10,<1.11
35
+commands = 
36
+    make build_sandbox

Loading…
Cancelar
Guardar