forked from genialis/resolwe-bio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
103 lines (95 loc) · 3.43 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
[tox]
envlist =
py36{,-partial},
docs,
linters,
packaging,
extra,
migrations
skip_missing_interpreters = True
[tox:jenkins]
# set Tox's working directory using environment variable when run on Jenkins
toxworkdir={env:TOX_WORKDIR}
# NOTE: Running 'pip check' after installation is necessary since pip currently
# lacks dependency resolution which means it can silently create broken
# installations.
# For more details, see: https://github.com/pypa/pip/issues/988
[testenv]
install_command = pip install {opts} {packages}
extras = test
commands =
# verify installed packages have compatible dependencies
pip check
# run tests
python tests/manage.py test {env:TEST_SUITE:resolwe_bio} --noinput \
# only test changes against a given Git commit reference for *-partial
# testing environments (default to "master" branch)
py36-partial: --only-changes-to \
py36-partial: {env:RESOLWE_TEST_ONLY_CHANGES_TO:master} \
py36-partial: --changes-file-types .resolwebio-filetypes.yml \
--verbosity 2 --parallel
# it is necessary to explicitly list the environment variables that need to be
# passed from Tox's invocation environment to the testing environment
passenv = TOXENV RESOLWE_* RESOLWEBIO_* DOCKER_* DJANGO_TEST_PROCESSES
[testenv:docs]
# we want to always build documentation with Python 3.6
basepython = python3.6
extras = docs
commands =
# verify installed packages have compatible dependencies
pip check
# build documentation
python setup.py build_sphinx --fresh-env --warning-is-error
[testenv:linters]
# we want to always run linters with Python 3.6
basepython = python3.6
# run all linters to see their output even if one of them fails
ignore_errors = True
setenv =
# enable pylint to find modules in tools package even if it is not
# installed
PYTHONPATH = {toxinidir}/resolwe_bio/tools
commands =
# verify installed packages have compatible dependencies
pip check
# run pylint
pylint resolwe_bio .scripts/check_large_files.py
# check PEP 8
pycodestyle resolwe_bio .scripts
# check PEP 257
pydocstyle resolwe_bio .scripts
[testenv:packaging]
# we want to always run packaging tests with Python 3.6
basepython = python3.6
commands =
# verify installed packages have compatible dependencies
pip check
# confirm that items checked into git are in sdist
check-manifest
# verify package metadata and confirm the long_description will render
# correctly on PyPI
python setup.py check --metadata --restructuredtext --strict
[testenv:extra]
# we want to always run extra tests with Python 3.6
basepython = python3
# we don't need to install the package for this test
skip_install = True
commands =
# check that there are no large test files in resolwe_bio/tests/files
python .scripts/check_large_files.py resolwe_bio/tests/files
[testenv:migrations]
# we want to always run migrations tests with Python 3.6
basepython = python3.6
whitelist_externals =
bash
psql
commands =
psql --username={env:RESOLWE_POSTGRESQL_USER:resolwe} \
--host={env:RESOLWE_POSTGRESQL_HOST:localhost} \
--port={env:RESOLWE_POSTGRESQL_PORT:5432} \
--command='CREATE DATABASE "'\
{env:RESOLWE_POSTGRESQL_NAME:resolwe-bio}'"'
python tests/manage.py migrate
bash -c '[[ $(./tests/manage.py makemigrations --dry-run) = '\
'"No changes detected" ]] || exit 1'
passenv = TOXENV RESOLWE_* RESOLWEBIO_*