forked from cloud-custodian/cloud-custodian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
101 lines (84 loc) · 3.11 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
[flake8]
exclude = setup.py,.git,venv,python2.7,bin,docs,__init__.py,.tox,tools/c7n_azure/c7n_azure/cache
; E401 is 'multiple imports on one line' -- no big deal
; E128 is under identation
; E203 is whitespace before ':'
; E221 is multiple spaces before operator
; E231 is missing whitespace after ,/:
; E251 is unexpected spaces around keywords
; ignore = E401,E128,E203,E221,E251
ignore = E128,E401,W503,W504,E741
max-line-length = 100
[tox]
envlist = py36,py37,py38,py39,lint
[testenv]
usedevelop = true
deps =
-rrequirements-dev.txt
setenv =
AWS_DEFAULT_REGION=us-east-1
AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_SESSION_TOKEN=fake
C7N_TEST_RUN=true
AZURE_ACCESS_TOKEN=fake_token
AZURE_SUBSCRIPTION_ID=ea42f556-5106-4743-99b0-c129bfa71a47
AZURE_TENANT_ID=ea42f556-5106-4743-99b0-000000000000
GOOGLE_CLOUD_PROJECT=custodian-1291
GOOGLE_APPLICATION_CREDENTIALS=tools/c7n_gcp/tests/data/credentials.json
[testenv:py38]
commands =
pytest -n {env:C7N_TEST_WORKERS:auto} tests tools {posargs}
[testenv:py38-cov]
commands =
pytest -vv -n {env:C7N_TEST_WORKERS:auto} --cov c7n --cov tools/c7n_azure/c7n_azure --cov tools/c7n_gcp/c7n_gcp --cov tools/c7n_kube/c7n_kube --cov tools/c7n_mailer/c7n_mailer --cov tools/c7n_terraform/c7n_terraform tests tools {posargs}
[testenv:py36]
commands =
pytest -n {env:C7N_TEST_WORKERS:auto} tests tools {posargs}
[testenv:py36-cov]
commands =
pytest -n {env:C7N_TEST_WORKERS:auto} --cov c7n --cov tools/c7n_azure/c7n_azure --cov tools/c7n_gcp/c7n_gcp --cov tools/c7n_kube/c7n_kube --cov tools/c7n_mailer/c7n_mailer tests tools {posargs}
[testenv:py37]
;; override because this runner will run with schema validation on test policies
;; by setting C7N_VALIDATE=true
setenv =
AWS_DEFAULT_REGION=us-east-1
AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_SESSION_TOKEN=fake
C7N_TEST_RUN=true
AZURE_ACCESS_TOKEN=fake_token
AZURE_SUBSCRIPTION_ID=ea42f556-5106-4743-99b0-c129bfa71a47
AZURE_TENANT_ID=ea42f556-5106-4743-99b0-000000000000
GOOGLE_CLOUD_PROJECT=custodian-1291
GOOGLE_APPLICATION_CREDENTIALS=tools/c7n_gcp/tests/data/credentials.json
C7N_VALIDATE=true
commands =
py.test -n {env:C7N_TEST_WORKERS:auto} tests tools {posargs}
[testenv:py37-windows]
;; separate out win32 as the default py37 runner is running with validation
commands =
pytest -n {env:C7N_TEST_WORKERS:auto} tests tools {posargs}
[testenv:py37-cov]
commands =
pytest -n {env:C7N_TEST_WORKERS:auto} --cov c7n --cov tools/c7n_azure/c7n_azure --cov tools/c7n_gcp/c7n_gcp --cov tools/c7n_kube/c7n_kube --cov tools/c7n_mailer/c7n_mailer tests tools {posargs}
[testenv:pypy]
commands =
pytest -n {env:C7N_TEST_WORKERS:auto} tests tools {posargs}
[testenv:lint]
commands = make lint
[testenv:docs]
whitelist_externals = make
commands = make sphinx
deps =
-rrequirements-dev.txt
-rrequirements-docs.txt
[pytest]
junit_family=xunit1
; for travis, we set this up as env var that we can override to limit concurrency
addopts= --tb=native
markers =
functional
skiplive
python_files = test_*.py
norecursedirs = data cassettes templates