forked from project-koku/koku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
140 lines (131 loc) · 4.59 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[tox]
envlist = py37, py36, lint
skipsdist = True
[travis]
python =
3.6: py36
3.7: py37
[flake8]
; D106 = Missing docstring in public nested class
; D212 = Multi-line docstring summary should start at the first line
; W503 = Line break before binary operator
ignore = D106,D212,W503
max-complexity = 10
max-line-length = 120
exclude =
**/migrations/*.py
**/manage.py
**/settings.py
koku/masu/test
import-order-style = pycharm
application-import-names = koku, api, providers, reporting, reporting_common, cost_models, masu
[testenv]
passenv = CI TRAVIS TRAVIS_* LDFLAGS CPPFLAGS CODECOV_TOKEN PIP_TRUSTED_HOST PIPENV_PYPI_MIRROR
setenv =
DATABASE_SERVICE_NAME={env:DATABASE_SERVICE_NAME:POSTGRES_SQL}
DATABASE_ENGINE={env:DATABASE_ENGINE:postgresql}
DATABASE_NAME={env:DATABASE_NAME:koku_test}
POSTGRES_SQL_SERVICE_HOST={env:POSTGRES_SQL_SERVICE_HOST:localhost}
POSTGRES_SQL_SERVICE_PORT={env:POSTGRES_SQL_SERVICE_PORT:15432}
DATABASE_ADMIN={env:DATABASE_ADMIN:postgres}
DATABASE_USER=koku_tester
DATABASE_PASSWORD={env:DATABASE_PASSWORD:''}
prometheus_multiproc_dir=/tmp
deps =
pipenv
codecov
commands =
/bin/sh {toxinidir}/scripts/check_postgres_running.sh
/bin/sh {toxinidir}/scripts/create_test_db_user.sh
pipenv install --dev --ignore-pipfile
coverage run {toxinidir}/koku/manage.py test --noinput -v 2 {posargs: koku/}
coverage report --show-missing
# The same tests as testenv, but run in parallel
[testenv:parallel]
passenv = CI TRAVIS TRAVIS_* LDFLAGS CPPFLAGS
setenv =
DATABASE_SERVICE_NAME={env:DATABASE_SERVICE_NAME:POSTGRES_SQL}
DATABASE_ENGINE={env:DATABASE_ENGINE:postgresql}
DATABASE_NAME={env:DATABASE_NAME:koku_test}
POSTGRES_SQL_SERVICE_HOST={env:POSTGRES_SQL_SERVICE_HOST:localhost}
POSTGRES_SQL_SERVICE_PORT={env:POSTGRES_SQL_SERVICE_PORT:15432}
DATABASE_ADMIN={env:DATABASE_ADMIN:postgres}
DATABASE_USER=koku_tester
DATABASE_PASSWORD={env:DATABASE_PASSWORD:''}
prometheus_multiproc_dir=/tmp
deps =
pipenv
codecov
commands =
/bin/sh {toxinidir}/scripts/check_postgres_running.sh
/bin/sh {toxinidir}/scripts/create_test_db_user.sh
pipenv install --dev --ignore-pipfile
coverage run --parallel-mode --concurrency=multiprocessing {toxinidir}/koku/manage.py test --noinput --parallel -v 2 {posargs: koku/}
coverage combine
coverage report --show-missing
[testenv:masu]
passenv = CI TRAVIS TRAVIS_* LDFLAGS CPPFLAGS
setenv =
DATABASE_SERVICE_NAME={env:DATABASE_SERVICE_NAME:POSTGRES_SQL}
DATABASE_ENGINE={env:DATABASE_ENGINE:postgresql}
DATABASE_NAME={env:DATABASE_NAME:koku_test}
POSTGRES_SQL_SERVICE_HOST={env:POSTGRES_SQL_SERVICE_HOST:localhost}
POSTGRES_SQL_SERVICE_PORT={env:POSTGRES_SQL_SERVICE_PORT:15432}
DATABASE_ADMIN={env:DATABASE_ADMIN:postgres}
DATABASE_USER=koku_tester
DATABASE_PASSWORD={env:DATABASE_PASSWORD:''}
prometheus_multiproc_dir=/tmp
deps =
pipenv
codecov
commands =
/bin/sh {toxinidir}/scripts/create_test_db_user.sh {env:DATABASE_USER} {env:DATABASE_ADMIN}
pipenv install --dev --ignore-pipfile
coverage run --parallel-mode --concurrency=multiprocessing {toxinidir}/koku/manage.py test --noinput --parallel -v 2 {posargs: koku/masu/}
coverage report --show-missing
[testenv:lint]
deps =
flake8
flake8-import-order
flake8-quotes
pipenv
pylint
pylint-plugin-utils
pylint-django
setenv =
PYTHONPATH={toxinidir}
commands =
flake8 koku
pipenv install --dev --ignore-pipfile
; R0801 = Similar lines of code.
pylint -j 0 --ignore=test --disable=R0801 --load-plugins=pylint_django koku/koku koku/masu/database
[testenv:for_travis]
passenv = CI TRAVIS TRAVIS_* LDFLAGS CPPFLAGS CODECOV_TOKEN COVERALLS_REPO_TOKEN CC_TEST_REPORTER_ID
setenv =
DATABASE_SERVICE_NAME={env:DATABASE_SERVICE_NAME:POSTGRES_SQL}
DATABASE_ENGINE={env:DATABASE_ENGINE:postgresql}
DATABASE_NAME={env:DATABASE_NAME:koku_test}
POSTGRES_SQL_SERVICE_HOST={env:POSTGRES_SQL_SERVICE_HOST:localhost}
POSTGRES_SQL_SERVICE_PORT={env:POSTGRES_SQL_SERVICE_PORT:15432}
DATABASE_ADMIN={env:DATABASE_ADMIN:postgres}
DATABASE_USER=koku_tester
DATABASE_PASSWORD={env:DATABASE_PASSWORD:''}
prometheus_multiproc_dir=/tmp
PYTHONPATH={toxinidir}
deps =
codecov
flake8
flake8-import-order
flake8-quotes
pipenv
pylint
pylint-plugin-utils
pylint-django
commands =
flake8 koku
pipenv install --dev --ignore-pipfile
pylint -j 0 --ignore=test --disable=R0801 --load-plugins=pylint_django koku/koku koku/masu/database
/bin/sh {toxinidir}/scripts/check_postgres_running.sh
/bin/sh {toxinidir}/scripts/create_test_db_user.sh
coverage run {toxinidir}/koku/manage.py test --noinput -v 2 {posargs: koku/}
coverage report --show-missing