2015-09-14 06:54:57 +03:00
|
|
|
; tox configuration file for running tests similar to buildbot builders.
|
2016-07-10 13:55:05 +03:00
|
|
|
;
|
2016-08-21 13:21:24 +03:00
|
|
|
; The main trial based environments are defined based on a set of tags. Each
|
|
|
|
; tag will trigger a different behavior. Multiple tags can be set for the same environment:
|
|
|
|
;
|
2016-08-21 16:12:46 +03:00
|
|
|
; * alldeps - install all possible dependencies.
|
|
|
|
; * nodeps - avoid installing any dependency.
|
2016-08-21 13:21:24 +03:00
|
|
|
; * withcov - run the tests wrapped using the coverage.
|
|
|
|
; * nocov - run the tests directly, without using the coverage wrapper.
|
2016-08-21 16:12:46 +03:00
|
|
|
; * wheel - build the wheel distribution
|
2016-09-25 00:57:16 +03:00
|
|
|
; * posix - prepare the tests to be run in a Linux/Unix/macOS environment.
|
2016-09-25 03:04:22 +03:00
|
|
|
; * macos - prepare the tests to be run in a OS X 10.11+ environment (superset of posix)
|
|
|
|
; * macos1010 - prepare the tests to be run in a OS X 10.10 environment (superset of posix)
|
2016-08-21 13:21:24 +03:00
|
|
|
; * windows - prepare the tests to be executed under Windows.
|
|
|
|
;
|
2016-08-21 15:06:05 +03:00
|
|
|
; Some tags are defined only while transitioning to an updated Buildbot and
|
|
|
|
; should be removed after the transition.
|
|
|
|
; See: https://github.com/twisted-infra/braid/issues/222
|
|
|
|
;
|
|
|
|
; * tests - similar to alldeps
|
2016-08-21 15:11:21 +03:00
|
|
|
; * coverage - similar to withcov and alldeps
|
2016-08-21 15:06:05 +03:00
|
|
|
; * nomodules - similar to nodeps
|
|
|
|
;
|
2016-07-13 22:02:04 +03:00
|
|
|
; There is a non-default `codecov-publish` environment used to publish the
|
|
|
|
; coverage results to codecov.io. It should be called after running the
|
|
|
|
; standard coverage environment.
|
2016-07-10 13:55:05 +03:00
|
|
|
;
|
2016-07-31 16:07:08 +03:00
|
|
|
; A non-default `txchecker-travis` environment is used to run twistedchecker
|
|
|
|
; on travis in --diff mode
|
|
|
|
;
|
2015-09-14 06:54:57 +03:00
|
|
|
[tox]
|
2015-11-18 04:35:52 +02:00
|
|
|
skip_missing_interpreters=True
|
2015-09-14 06:54:57 +03:00
|
|
|
toxworkdir=build/
|
|
|
|
envlist=
|
2016-09-25 03:14:05 +03:00
|
|
|
{py27,py33,py34,py35}-{alldeps,nodeps}-{withcov,nocov}-{posix,macos,macos1010,windows}
|
2016-08-21 16:12:46 +03:00
|
|
|
{py27,py35}-wheel
|
2016-08-21 15:06:05 +03:00
|
|
|
pyflakes,twistedchecker,apidocs,narrativedocs,topfile,manifest-checker
|
|
|
|
|
2015-09-14 06:54:57 +03:00
|
|
|
|
|
|
|
[testenv]
|
|
|
|
deps =
|
2016-10-16 02:08:23 +03:00
|
|
|
{alldeps,tests,coverage}: .[all_non_platform]
|
2016-08-21 15:06:05 +03:00
|
|
|
|
2016-09-25 00:57:16 +03:00
|
|
|
py27-{alldeps,tests,coverage}-{posix,macos}: pysqlite
|
2016-06-30 16:45:43 +03:00
|
|
|
|
2016-10-16 02:08:23 +03:00
|
|
|
windows: .[windows_platform]
|
2016-09-25 03:04:22 +03:00
|
|
|
|
2016-10-16 02:08:23 +03:00
|
|
|
{alldeps,tests}-macos: .[osx_platform]
|
2016-09-25 03:04:22 +03:00
|
|
|
|
2016-08-21 15:24:20 +03:00
|
|
|
{withcov,coverage}: coverage
|
2016-06-30 16:45:43 +03:00
|
|
|
|
2016-08-21 14:30:41 +03:00
|
|
|
codecov-publish: codecov
|
2016-08-21 13:21:24 +03:00
|
|
|
|
2016-08-21 16:12:46 +03:00
|
|
|
wheel: wheel
|
|
|
|
|
2016-06-30 16:45:43 +03:00
|
|
|
; Code quality checkers
|
2016-08-21 13:21:24 +03:00
|
|
|
pyflakes{,3}: pyflakes
|
|
|
|
manifest-checker: check-manifest
|
|
|
|
|
|
|
|
{twistedchecker,txchecker}: twistedchecker>=0.6.0
|
|
|
|
txchecker: diff_cover
|
2016-06-30 16:45:43 +03:00
|
|
|
|
|
|
|
; Documentation
|
2016-10-16 02:08:23 +03:00
|
|
|
narrativedocs: .[dev]
|
2016-06-30 16:45:43 +03:00
|
|
|
|
2016-08-21 13:21:24 +03:00
|
|
|
; All environment variables are passed.
|
|
|
|
passenv = *
|
|
|
|
|
2016-05-08 18:53:41 +03:00
|
|
|
setenv =
|
2016-08-21 16:12:46 +03:00
|
|
|
; Enable sub-processes coverage reports and store coverage reports in a
|
|
|
|
; known location.
|
2016-05-08 18:53:41 +03:00
|
|
|
COVERAGE_PROCESS_START = {toxinidir}/.coveragerc
|
2016-08-21 13:21:24 +03:00
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage
|
2016-08-21 13:53:37 +03:00
|
|
|
# Help tests know where the base directory is.
|
|
|
|
TOX_INI_DIR = {toxinidir}
|
2015-09-14 06:54:57 +03:00
|
|
|
|
|
|
|
commands =
|
2016-08-21 16:12:46 +03:00
|
|
|
;
|
|
|
|
; Display information about Python interpreter
|
|
|
|
; which will be used in subsequent steps
|
|
|
|
;
|
2016-08-05 01:06:41 +03:00
|
|
|
python -c "import sys; print(sys.prefix)"
|
|
|
|
python -c "import sys; print(sys.exec_prefix)"
|
|
|
|
python -c "import sys; print(sys.executable)"
|
|
|
|
python --version
|
2016-07-12 06:34:27 +03:00
|
|
|
|
|
|
|
; Install PyDoctor here so it DOESNT overwrite Twisted
|
2016-09-21 06:32:07 +03:00
|
|
|
py27-{alldeps,tests}: pip install --no-deps epydoc pydoctor
|
2016-07-23 17:19:21 +03:00
|
|
|
apidocs: pip install --no-deps epydoc pydoctor
|
2016-07-12 06:34:27 +03:00
|
|
|
|
2016-08-21 16:12:46 +03:00
|
|
|
; Run tests without wrapping them using coverage.
|
2016-08-21 15:07:01 +03:00
|
|
|
{nocov,nomodules,tests}: python -m twisted.trial --reactor={env:TWISTED_REACTOR:default} --reporter={env:TRIAL_REPORTER:verbose} {posargs:twisted}
|
2015-09-14 06:54:57 +03:00
|
|
|
|
2016-08-21 16:12:46 +03:00
|
|
|
; Run the tests wrapped using coverage.
|
2016-08-21 15:06:05 +03:00
|
|
|
{withcov,coverage}: python {toxinidir}/admin/_copy.py {toxinidir}/admin/zz_coverage.pth {envsitepackagesdir}/zz_coverage.pth
|
|
|
|
{withcov,coverage}: coverage erase
|
|
|
|
{withcov,coverage}: coverage run -p --rcfile={toxinidir}/.coveragerc -m twisted.trial --reactor={env:TWISTED_REACTOR:default} --reporter={env:TRIAL_REPORTER:verbose} {posargs:twisted}
|
2016-07-10 13:55:05 +03:00
|
|
|
|
2016-08-21 16:12:46 +03:00
|
|
|
; Publish the coverage reports to codecov.io
|
2016-08-05 03:30:30 +03:00
|
|
|
codecov-publish: coverage combine
|
2016-07-13 22:02:04 +03:00
|
|
|
codecov-publish: coverage xml -o coverage.xml -i
|
|
|
|
codecov-publish: codecov {env:CODECOV_OPTIONS:}
|
2015-09-14 06:54:57 +03:00
|
|
|
|
2016-08-21 16:12:46 +03:00
|
|
|
; Build in a root folder so that buildbot can pick the result
|
|
|
|
wheel: python setup.py bdist_wheel --dist-dir {toxinidir}/dist
|
|
|
|
|
2016-07-15 09:40:11 +03:00
|
|
|
twistedchecker: twistedchecker src/{posargs:twisted}
|
2016-07-31 16:07:08 +03:00
|
|
|
txchecker-travis: {toxinidir}/.travis/twistedchecker-trunk-diff.sh {posargs:twisted}
|
2015-09-14 06:54:57 +03:00
|
|
|
|
2016-08-17 11:33:16 +03:00
|
|
|
pyflakes: pyflakes {posargs:src/twisted admin bin}
|
|
|
|
pyflakes3: pyflakes {posargs:src/twisted/internet/test/_awaittests.py.3only}
|
2016-06-28 19:39:34 +03:00
|
|
|
|
2016-07-23 17:12:41 +03:00
|
|
|
apidocs: {toxinidir}/bin/admin/build-apidocs {toxinidir}/src/ apidocs
|
2015-11-18 04:35:52 +02:00
|
|
|
narrativedocs: sphinx-build -aW -b html -d {toxinidir}/docs/_build {toxinidir}/docs {toxinidir}/docs/_build/
|
2015-09-14 06:54:57 +03:00
|
|
|
|
2016-05-20 10:37:31 +03:00
|
|
|
topfile: python {toxinidir}/bin/admin/check-topfile "{toxinidir}"
|
2016-05-18 08:15:27 +03:00
|
|
|
|
2016-07-20 10:07:11 +03:00
|
|
|
manifest-checker: check-manifest --ignore "docs/_build*,docs/historic/*,admin*,bin/admin*,twisted/topfiles/*.Old"
|
2016-07-20 09:41:19 +03:00
|
|
|
|
2015-11-07 02:09:38 +02:00
|
|
|
[testenv:twistedchecker]
|
2015-11-18 04:35:52 +02:00
|
|
|
basepython=python2.7
|
2015-11-07 02:09:38 +02:00
|
|
|
[testenv:pyflakes]
|
2015-11-18 04:35:52 +02:00
|
|
|
basepython=python2.7
|
2016-07-17 13:52:35 +03:00
|
|
|
[testenv:pyflakes3]
|
2016-08-01 23:07:09 +03:00
|
|
|
basepython=python3.5
|
2015-11-18 04:35:52 +02:00
|
|
|
[testenv:apidocs]
|
|
|
|
basepython=python2.7
|
2016-05-18 08:15:27 +03:00
|
|
|
[testenv:topfile]
|
|
|
|
basepython=python2.7
|
2016-07-20 09:41:19 +03:00
|
|
|
[testenv:manifest-checker]
|
|
|
|
basepython=python2.7
|