# Tox (http://tox.testrun.org/) is a tool for running tests in # multiple virtualenvs. To use it, "pip install tox" and then run # "tox" from this directory. [tox] skipsdist = true envlist = modification,py{26,33,34,35,36},cover,lint # nosetest -v => more verbose output, allows to detect busy waiting # loops, especially on Travis [base] # pip installs the requested packages in editable mode pip_install = {toxinidir}/tools/pip_install_editable.sh # pip installs the requested packages in editable mode and runs unit tests on # them. Each package is installed and tested in the order they are provided # before the script moves on to the next package. If CERTBOT_NO_PIN is set not # set to 1, packages are installed using certbot-auto's requirements file as # constraints. install_and_test = {toxinidir}/tools/install_and_test.sh py26_packages = acme[dev] \ .[dev] \ certbot-apache \ certbot-dns-cloudflare \ certbot-dns-digitalocean \ certbot-dns-google \ certbot-dns-rfc2136 \ certbot-dns-route53 \ certbot-nginx \ letshelp-certbot non_py26_packages = certbot-dns-cloudxns \ certbot-dns-dnsimple \ certbot-dns-dnsmadeeasy \ certbot-dns-luadns \ certbot-dns-nsone all_packages = {[base]py26_packages} {[base]non_py26_packages} install_packages = {toxinidir}/tools/pip_install_editable.sh {[base]all_packages} source_paths = acme/acme certbot certbot-apache/certbot_apache certbot-compatibility-test/certbot_compatibility_test certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-cloudxns/certbot_dns_cloudxns certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-dnsimple/certbot_dns_dnsimple certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy certbot-dns-google/certbot_dns_google certbot-dns-luadns/certbot_dns_luadns certbot-dns-nsone/certbot_dns_nsone certbot-dns-rfc2136/certbot_dns_rfc2136 certbot-dns-route53/certbot_dns_route53 certbot-nginx/certbot_nginx letshelp-certbot/letshelp_certbot tests/lock_test.py [testenv:py26] commands = {[base]install_and_test} {[base]py26_packages} python tests/lock_test.py [testenv] commands = {[testenv:py26]commands} {[base]install_and_test} {[base]non_py26_packages} setenv = PYTHONPATH = {toxinidir} PYTHONHASHSEED = 0 [testenv:py27-oldest] commands = {[testenv]commands} setenv = {[testenv]setenv} CERTBOT_NO_PIN=1 deps = PyOpenSSL==0.13 cffi==1.5.2 configargparse==0.10.0 configargparse==0.10.0 configobj==4.7.2 cryptography==1.2.3 enum34==0.9.23 google-api-python-client==1.5 idna==2.0 ipaddress==1.0.16 mock==1.0.1 ndg-httpsclient==0.3.2 oauth2client==2.0 parsedatetime==1.4 pyasn1-modules==0.0.5 pyasn1==0.1.9 pyparsing==1.5.6 pyrfc3339==1.0 python-augeas==0.4.1 pytz==2012c requests[security]==2.6.0 setuptools==0.9.8 six==1.9.0 urllib3==1.10 zope.component==4.0.2 zope.event==4.0.1 zope.interface==4.0.5 [testenv:py27_install] basepython = python2.7 commands = {[base]install_packages} [testenv:cover] basepython = python2.7 commands = {[base]install_packages} ./tox.cover.sh [testenv:lint] # recent versions of pylint do not support Python 2.6 (#97, #187) basepython = python2.7 # separating into multiple invocations disables cross package # duplicate code checking; if one of the commands fails, others will # continue, but tox return code will reflect previous error commands = {[base]install_packages} pylint --reports=n --rcfile=.pylintrc {[base]source_paths} [testenv:mypy] basepython = python3.4 commands = {[base]pip_install} mypy {[base]install_packages} mypy --py2 --ignore-missing-imports {[base]source_paths} [testenv:apacheconftest] #basepython = python2.7 commands = {[base]pip_install} acme . certbot-apache certbot-compatibility-test {toxinidir}/certbot-apache/certbot_apache/tests/apache-conf-files/apache-conf-test --debian-modules [testenv:nginxroundtrip] commands = {[base]pip_install} acme . certbot-apache certbot-nginx python certbot-compatibility-test/nginx/roundtrip.py certbot-compatibility-test/nginx/nginx-roundtrip-testdata # This is a duplication of the command line in testenv:le_auto to # allow users to run the modification check by running `tox` [testenv:modification] commands = {toxinidir}/tests/modification-check.sh [testenv:apache_compat] commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . docker run --rm -it apache-compat -c apache.tar.gz -vvvv whitelist_externals = docker passenv = DOCKER_* [testenv:nginx_compat] commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie whitelist_externals = docker passenv = DOCKER_* [testenv:le_auto_precise] # At the moment, this tests under Python 2.7 only, as only that version is # readily available on the Precise Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.precise -t lea letsencrypt-auto-source docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* [testenv:le_auto_trusty] # At the moment, this tests under Python 2.7 only, as only that version is # readily available on the Trusty Docker image. commands = {toxinidir}/tests/modification-check.sh docker build -f letsencrypt-auto-source/Dockerfile.trusty -t lea letsencrypt-auto-source docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* TRAVIS_BRANCH [testenv:le_auto_wheezy] # At the moment, this tests under Python 2.7 only, as only that version is # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.wheezy -t lea letsencrypt-auto-source docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* [testenv:le_auto_centos6] # At the moment, this tests under Python 2.6 only, as only that version is # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.centos6 -t lea letsencrypt-auto-source docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* [testenv:docker_dev] # tests the Dockerfile-dev file to ensure development with it works # as expected commands = docker-compose run --rm --service-ports development bash -c 'tox -e lint' whitelist_externals = docker passenv = DOCKER_*