summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 8f1be3d1ff080df6990e20d53b284384d933f358 (plain)
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
[tox]
envlist = py{36,27},pep8,pylint,docs
skipsdist = True

[testenv]
usedevelop = True
deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt

passenv =
    FREEZER_TEST_SSH_KEY
    FREEZER_TEST_SSH_USERNAME
    FREEZER_TEST_SSH_HOST
    FREEZER_TEST_CONTAINER
    FREEZER_TEST_OS_TENANT_NAME
    FREEZER_TEST_OS_USERNAME
    FREEZER_TEST_OS_REGION_NAME
    FREEZER_TEST_OS_PASSWORD
    FREEZER_TEST_OS_AUTH_URL
    FREEZER_TEST_NO_LVM
    http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY

install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
    VIRTUAL_ENV={envdir}
    OS_TEST_PATH = ./freezer/tests/unit
    PYTHON=coverage run --source freezer --parallel-mode
commands =
    find . -type f -name "*.pyc" -delete
    stestr run {posargs}
    coverage combine
    coverage html -d cover
    coverage xml -o cover/coverage.xml
    coverage report -m
    rm -f .coverage
    rm -rf .testrepository

whitelist_externals =
    find
    coverage
    rm

python_files = test_*.py
norecursedirs  = .tox .venv

[testenv:venv]
basepython = python3
commands = {posargs}

[testenv:py27]
basepython = python2.7

[testenv:py35]
basepython = python3.5

[testenv:py36]
basepython = python3.6

[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
whitelist_externals = rm
commands =
  rm -rf doc/build/
  sphinx-build -b html doc/source doc/build/html


[testenv:pep8]
basepython = python3
commands =
    flake8 freezer
    doc8 {posargs}

[testenv:pylint]
basepython = python3
commands = pylint --rcfile .pylintrc freezer

[flake8]
ignore = H405,H404,H403,H401
show-source = True
enable-extensions = H203,H106
exclude = .venv,.tox,dist,doc,test,*egg,releasenotes

[doc8]
ignore = D000,D001
ignore-path = .venv,.git,.tox,.tmp,*freezer/locale*,*lib/python*,freezer.egg*,doc/build,releasenotes/*,doc/source/contributor/api

[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
whitelist_externals = rm
commands =
  rm -rf releasenotes/build
  sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:lower-constraints]
basepython = python3
deps =
  -c{toxinidir}/lower-constraints.txt
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt