2020-09-23 13:36:55 -04:00
|
|
|
# Tox (https://tox.readthedocs.io/) is a tool for running tests in
|
2015-01-28 07:56:12 -05:00
|
|
|
# multiple virtualenvs. To use it, "pip install tox" and then run
|
|
|
|
|
# "tox" from this directory.
|
2014-11-22 09:02:52 -05:00
|
|
|
|
|
|
|
|
[tox]
|
2015-07-10 12:34:08 -04:00
|
|
|
skipsdist = true
|
2021-07-29 14:25:25 -04:00
|
|
|
envlist = {py3-cover,lint,mypy}-{win,posix}
|
2016-01-19 12:22:53 -05:00
|
|
|
|
2017-05-08 14:54:12 -04:00
|
|
|
[base]
|
2017-06-08 15:22:46 -04:00
|
|
|
# pip installs the requested packages in editable mode
|
2018-11-07 20:16:16 -05:00
|
|
|
pip_install = python {toxinidir}/tools/pip_install_editable.py
|
2017-06-08 15:22:46 -04:00
|
|
|
# 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
|
2017-12-18 15:31:36 -05:00
|
|
|
# before the script moves on to the next package. All dependencies are pinned
|
|
|
|
|
# to a specific version for increased stability for developers.
|
2018-11-07 20:16:16 -05:00
|
|
|
install_and_test = python {toxinidir}/tools/install_and_test.py
|
2021-06-01 17:46:06 -04:00
|
|
|
# Packages are listed on one line because tox seems to have inconsistent
|
|
|
|
|
# behavior with substitutions that contain line continuations, see
|
|
|
|
|
# https://github.com/tox-dev/tox/issues/2069 for more info.
|
|
|
|
|
dns_packages = certbot-dns-cloudflare certbot-dns-cloudxns certbot-dns-digitalocean certbot-dns-dnsimple certbot-dns-dnsmadeeasy certbot-dns-gehirn certbot-dns-google certbot-dns-linode certbot-dns-luadns certbot-dns-nsone certbot-dns-ovh certbot-dns-rfc2136 certbot-dns-route53 certbot-dns-sakuracloud
|
2021-07-29 14:25:25 -04:00
|
|
|
win_all_packages = acme[test] certbot[test] {[base]dns_packages} certbot-nginx
|
|
|
|
|
all_packages = {[base]win_all_packages} certbot-apache
|
2022-01-12 19:36:51 -05:00
|
|
|
fully_typed_source_paths = acme/acme certbot/certbot certbot-ci/certbot_integration_tests certbot-ci/snap_integration_tests certbot-ci/windows_installer_integration_tests 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-gehirn/certbot_dns_gehirn certbot-dns-google/certbot_dns_google certbot-dns-linode/certbot_dns_linode certbot-dns-luadns/certbot_dns_luadns certbot-dns-nsone/certbot_dns_nsone certbot-dns-ovh/certbot_dns_ovh certbot-dns-rfc2136/certbot_dns_rfc2136 certbot-dns-route53/certbot_dns_route53 certbot-dns-sakuracloud/certbot_dns_sakuracloud certbot-nginx/certbot_nginx tests/lock_test.py
|
|
|
|
|
partially_typed_source_paths = certbot-apache/certbot_apache
|
2017-05-08 14:54:12 -04:00
|
|
|
|
2017-06-21 16:50:48 -04:00
|
|
|
[testenv]
|
2019-01-17 16:02:35 -05:00
|
|
|
passenv =
|
|
|
|
|
CERTBOT_NO_PIN
|
2021-07-29 14:25:25 -04:00
|
|
|
platform =
|
|
|
|
|
win: win32
|
|
|
|
|
posix: ^(?!.*win32).*$
|
2020-11-06 05:17:41 -05:00
|
|
|
commands_pre = python {toxinidir}/tools/pipstrap.py
|
2017-05-08 14:54:12 -04:00
|
|
|
commands =
|
2021-07-29 14:25:25 -04:00
|
|
|
!cover-win: {[base]install_and_test} {[base]win_all_packages}
|
|
|
|
|
!cover-!win: {[base]install_and_test} {[base]all_packages}
|
2020-04-16 11:59:40 -04:00
|
|
|
!cover: python tests/lock_test.py
|
2021-07-29 14:25:25 -04:00
|
|
|
|
|
|
|
|
cover-win: {[base]pip_install} {[base]win_all_packages}
|
|
|
|
|
cover-!win: {[base]pip_install} {[base]all_packages} certbot-apache[dev]
|
2020-04-16 11:59:40 -04:00
|
|
|
cover: python tox.cover.py
|
2020-02-05 17:37:39 -05:00
|
|
|
# We always recreate the virtual environment to avoid problems like
|
|
|
|
|
# https://github.com/certbot/certbot/issues/7745.
|
|
|
|
|
recreate = true
|
2017-06-21 16:50:48 -04:00
|
|
|
setenv =
|
2019-01-31 15:57:49 -05:00
|
|
|
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:--numprocesses auto}
|
2017-06-21 16:50:48 -04:00
|
|
|
PYTHONHASHSEED = 0
|
|
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:oldest]
|
|
|
|
|
# Setting basepython allows the tests to fail fast if that version of Python
|
|
|
|
|
# isn't available instead of potentially trying to use a newer version of
|
|
|
|
|
# Python which is unlikely to work.
|
2021-07-22 15:00:30 -04:00
|
|
|
#
|
|
|
|
|
# This version should be kept in sync with the one declared in
|
|
|
|
|
# tools/pinning/oldest/pyproject.toml.
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
basepython = python3.6
|
2017-06-21 16:50:48 -04:00
|
|
|
commands =
|
|
|
|
|
{[testenv]commands}
|
|
|
|
|
setenv =
|
|
|
|
|
{[testenv]setenv}
|
2017-12-18 15:31:36 -05:00
|
|
|
CERTBOT_OLDEST=1
|
2017-05-19 19:23:53 -04:00
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:acme-oldest]
|
|
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2018-03-05 12:50:19 -05:00
|
|
|
commands =
|
2021-06-11 16:17:50 -04:00
|
|
|
{[base]install_and_test} acme[test]
|
2018-03-05 12:50:19 -05:00
|
|
|
setenv =
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
{[testenv:oldest]setenv}
|
2018-03-05 12:50:19 -05:00
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:apache-oldest]
|
|
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2018-03-05 12:50:19 -05:00
|
|
|
commands =
|
2021-06-11 16:17:50 -04:00
|
|
|
{[base]pip_install} acme[test] certbot[test] certbot-apache
|
2021-06-01 17:46:06 -04:00
|
|
|
pytest certbot-apache
|
2018-03-05 12:50:19 -05:00
|
|
|
setenv =
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
{[testenv:oldest]setenv}
|
2018-03-05 12:50:19 -05:00
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:apache-v2-oldest]
|
|
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2020-01-07 12:57:43 -05:00
|
|
|
commands =
|
2021-06-11 16:17:50 -04:00
|
|
|
{[base]pip_install} acme[test] certbot[test] certbot-apache[dev]
|
2021-06-01 17:46:06 -04:00
|
|
|
pytest certbot-apache
|
2020-01-07 12:57:43 -05:00
|
|
|
setenv =
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
{[testenv:oldest]setenv}
|
2020-01-07 12:57:43 -05:00
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:certbot-oldest]
|
|
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2018-03-05 12:50:19 -05:00
|
|
|
commands =
|
2021-06-11 16:17:50 -04:00
|
|
|
{[base]pip_install} acme[test] certbot[test]
|
2021-06-01 17:46:06 -04:00
|
|
|
pytest certbot
|
2018-03-05 12:50:19 -05:00
|
|
|
setenv =
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
{[testenv:oldest]setenv}
|
2018-03-05 12:50:19 -05:00
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:dns-oldest]
|
|
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2018-03-05 12:50:19 -05:00
|
|
|
commands =
|
2021-06-11 16:17:50 -04:00
|
|
|
{[base]pip_install} acme[test] certbot[test] {[base]dns_packages}
|
2021-06-01 17:46:06 -04:00
|
|
|
pytest {[base]dns_packages}
|
2018-03-05 12:50:19 -05:00
|
|
|
setenv =
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
{[testenv:oldest]setenv}
|
2018-03-05 12:50:19 -05:00
|
|
|
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
[testenv:nginx-oldest]
|
|
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2018-03-05 12:50:19 -05:00
|
|
|
commands =
|
2021-06-11 16:17:50 -04:00
|
|
|
{[base]pip_install} acme[test] certbot[test] certbot-nginx
|
2021-06-01 17:46:06 -04:00
|
|
|
pytest certbot-nginx
|
2018-03-05 12:50:19 -05:00
|
|
|
python tests/lock_test.py
|
|
|
|
|
setenv =
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
{[testenv:oldest]setenv}
|
2018-07-17 23:00:12 -04:00
|
|
|
|
2021-01-29 18:31:11 -05:00
|
|
|
[testenv:external-mock]
|
|
|
|
|
commands =
|
|
|
|
|
python {toxinidir}/tools/pip_install.py mock
|
|
|
|
|
{[base]install_and_test} {[base]all_packages}
|
|
|
|
|
|
2021-07-29 14:25:25 -04:00
|
|
|
[testenv:lint{,-win,-posix}]
|
Lint certbot code on Python 3, and update Pylint to the latest version (#7551)
Part of #7550
This PR makes appropriate corrections to run pylint on Python 3.
Why not keeping the dependencies unchanged and just run pylint on Python 3?
Because the old version of pylint breaks horribly on Python 3 because of unsupported version of astroid.
Why updating pylint + astroid to the latest version ?
Because this version only fixes some internal errors occuring during the lint of Certbot code, and is also ready to run gracefully on Python 3.8.
Why upgrading mypy ?
Because the old version does not support the new version of astroid required to run pylint correctly.
Why not upgrading mypy to its latest version ?
Because this latest version includes a new typshed version, that adds a lot of new type definitions, and brings dozens of new errors on the Certbot codebase. I would like to fix that in a future PR.
That said so, the work has been to find the correct set of new dependency versions, then configure pylint for sane configuration errors in our situation, disable irrelevant lintings errors, then fixing (or ignoring for good reason) the remaining mypy errors.
I also made PyLint and MyPy checks run correctly on Windows.
* Start configuration
* Reconfigure travis
* Suspend a check specific to python 3. Start fixing code.
* Repair call_args
* Fix return + elif lints
* Reconfigure development to run mainly on python3
* Remove incompatible Python 3.4 jobs
* Suspend pylint in some assertions
* Remove pylint in dev
* Take first mypy that supports typed-ast>=1.4.0 to limit the migration path
* Various return + else lint errors
* Find a set of deps that is working with current mypy version
* Update local oldest requirements
* Remove all current pylint errors
* Rebuild letsencrypt-auto
* Update mypy to fix pylint with new astroid version, and fix mypy issues
* Explain type: ignore
* Reconfigure tox, fix none path
* Simplify pinning
* Remove useless directive
* Remove debugging code
* Remove continue
* Update requirements
* Disable unsubscriptable-object check
* Disable one check, enabling two more
* Plug certbot dev version for oldest requirements
* Remove useless disable directives
* Remove useless no-member disable
* Remove no-else-* checks. Use elif in symetric branches.
* Add back assertion
* Add new line
* Remove unused pylint disable
* Remove other pylint disable
2019-12-10 17:12:50 -05:00
|
|
|
basepython = python3
|
2015-07-10 09:40:51 -04:00
|
|
|
# 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
|
2014-11-27 14:13:21 -05:00
|
|
|
commands =
|
2021-07-29 14:25:25 -04:00
|
|
|
win: {[base]pip_install} {[base]win_all_packages}
|
|
|
|
|
!win: {[base]pip_install} {[base]all_packages}
|
2021-10-24 18:43:21 -04:00
|
|
|
python -m pylint --reports=n --rcfile=.pylintrc {[base]fully_typed_source_paths} {[base]partially_typed_source_paths}
|
2015-12-16 22:52:35 -05:00
|
|
|
|
Upgrade to mypy 0.812 (#8748)
Fixes #8425
This PR upgrades mypy to the latest version available, 0.812.
Given the advanced type inference capabilities provided by this newer version, this PRs also fixes various type inconsistencies that are now detected. Here are the non obvious changes done to fix types:
* typing in mixins has been solved using `Protocol` classes, as recommended by mypy (https://mypy.readthedocs.io/en/latest/more_types.html#mixin-classes, https://mypy.readthedocs.io/en/stable/protocols.html)
* `cast` when we are playing with `Union` types
This PR also disables the strict optional checks that have been enable by default in recent versions of mypy. Once this PR is merged, I will create an issue to study how these checks can be enabled.
`typing.Protocol` is available only since Python 3.8. To keep compatibility with Python 3.6, I try to import the class `Protocol` from `typing`, and fallback to assign `object` to `Protocol` if that fails. This way the code is working with all versions of Python, but the mypy check can be run only with Python 3.8+ because it needs the protocol feature. As a consequence, tox runs mypy under Python 3.8.
Alternatives are:
* importing `typing_extensions`, that proposes backport of newest typing features to Python 3.6, but this implies to add a dependency to Certbot just to run mypy
* redesign the concerned classes to not use mixins, or use them differently, but this implies to modify the code itself even if there is nothing wrong with it and it is just a matter of instructing mypy to understand in which context the mixins can be used
* ignoring type for these classes with `# type: ignore` but we loose the benefit of mypy for them
* Upgrade mypy
* First step for acme
* Cast for the rescue
* Fixing types for certbot
* Fix typing for certbot-nginx
* Finalize type fixes, configure no optional strict check for mypy in tox
* Align requirements
* Isort
* Pylint
* Protocol for python 3.6
* Use Python 3.9 for mypy, make code compatible with Python 3.8<
* Pylint and mypy
* Pragma no cover
* Pythonic NotImplemented constant
* More type definitions
* Add comments
* Simplify typing logic
* Use vararg tuple
* Relax constraints on mypy
* Add more type
* Do not silence error if target is not defined
* Conditionally import Protocol for type checking only
* Clean up imports
* Add comments
* Align python version linting with mypy and coverage
* Just ignore types in an unused module
* Add comments
* Fix lint
2021-04-02 14:54:40 -04:00
|
|
|
// TODO: Re-enable strict checks for optionals with appropriate type corrections or code redesign.
|
2021-07-29 14:25:25 -04:00
|
|
|
[testenv:mypy{,-win,-posix}]
|
2018-04-12 18:47:39 -04:00
|
|
|
basepython = python3
|
2017-03-18 22:10:10 -04:00
|
|
|
commands =
|
2021-07-29 14:25:25 -04:00
|
|
|
win: {[base]pip_install} {[base]win_all_packages}
|
2021-08-17 13:52:57 -04:00
|
|
|
!win: {[base]pip_install} {[base]all_packages} certbot-ci
|
2021-10-24 18:43:21 -04:00
|
|
|
mypy --disallow-untyped-defs {[base]fully_typed_source_paths}
|
|
|
|
|
mypy {[base]partially_typed_source_paths}
|
2017-03-18 22:10:10 -04:00
|
|
|
|
2015-12-22 18:50:48 -05:00
|
|
|
[testenv:apacheconftest]
|
2015-12-16 22:52:35 -05:00
|
|
|
commands =
|
2020-04-09 16:15:28 -04:00
|
|
|
{[base]pip_install} acme certbot certbot-apache
|
2019-11-27 12:57:35 -05:00
|
|
|
{toxinidir}/certbot-apache/tests/apache-conf-files/apache-conf-test --debian-modules
|
2019-01-09 15:37:45 -05:00
|
|
|
passenv =
|
|
|
|
|
SERVER
|
|
|
|
|
|
2020-04-09 16:15:28 -04:00
|
|
|
[testenv:apacheconftest-external-with-pebble]
|
|
|
|
|
# Run apacheconftest with pebble and Certbot outside of tox's virtual
|
|
|
|
|
# environment.
|
2019-01-09 15:37:45 -05:00
|
|
|
commands =
|
2020-04-09 16:15:28 -04:00
|
|
|
{[base]pip_install} certbot-ci
|
2019-11-27 12:57:35 -05:00
|
|
|
{toxinidir}/certbot-apache/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules
|
2016-04-10 14:44:28 -04:00
|
|
|
|
2020-04-09 16:15:28 -04:00
|
|
|
[testenv:apacheconftest-with-pebble]
|
|
|
|
|
commands =
|
|
|
|
|
{[base]pip_install} acme certbot certbot-apache
|
|
|
|
|
{[testenv:apacheconftest-external-with-pebble]commands}
|
|
|
|
|
|
2016-08-10 19:43:15 -04:00
|
|
|
[testenv:nginxroundtrip]
|
|
|
|
|
commands =
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
{[base]pip_install} acme certbot certbot-apache certbot-nginx
|
2016-08-10 19:43:15 -04:00
|
|
|
python certbot-compatibility-test/nginx/roundtrip.py certbot-compatibility-test/nginx/nginx-roundtrip-testdata
|
2016-01-08 16:55:52 -05:00
|
|
|
|
2016-10-28 18:05:25 -04:00
|
|
|
[testenv:modification]
|
|
|
|
|
commands =
|
2018-11-07 20:16:16 -05:00
|
|
|
python {toxinidir}/tests/modification-check.py
|
2016-10-28 18:05:25 -04:00
|
|
|
|
2016-08-10 19:33:56 -04:00
|
|
|
[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 .
|
2020-07-02 18:01:21 -04:00
|
|
|
docker run --rm -t apache-compat -c apache.tar.gz -vvvv
|
2016-08-10 19:33:56 -04:00
|
|
|
whitelist_externals =
|
|
|
|
|
docker
|
2018-07-31 13:31:36 -04:00
|
|
|
passenv =
|
|
|
|
|
DOCKER_*
|
2016-08-10 19:33:56 -04:00
|
|
|
|
|
|
|
|
[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 .
|
2020-07-02 18:01:21 -04:00
|
|
|
docker run --rm -t nginx-compat -c nginx.tar.gz -vv -aie
|
2016-08-10 19:33:56 -04:00
|
|
|
whitelist_externals =
|
|
|
|
|
docker
|
2018-07-31 13:31:36 -04:00
|
|
|
passenv =
|
|
|
|
|
DOCKER_*
|
2016-11-10 16:15:17 -05:00
|
|
|
|
2017-05-25 19:27:31 -04:00
|
|
|
[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 =
|
2018-11-30 17:44:47 -05:00
|
|
|
docker-compose
|
2017-05-25 19:27:31 -04:00
|
|
|
passenv = DOCKER_*
|
2019-03-01 16:18:06 -05:00
|
|
|
|
|
|
|
|
[testenv:integration]
|
|
|
|
|
commands =
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
{[base]pip_install} acme certbot certbot-nginx certbot-ci
|
2019-05-14 16:56:32 -04:00
|
|
|
pytest certbot-ci/certbot_integration_tests \
|
2019-03-01 16:18:06 -05:00
|
|
|
--acme-server={env:ACME_SERVER:pebble} \
|
|
|
|
|
--cov=acme --cov=certbot --cov=certbot_nginx --cov-report= \
|
2019-05-14 16:56:32 -04:00
|
|
|
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
|
2019-09-06 17:30:25 -04:00
|
|
|
coverage report --include 'certbot/*' --show-missing --fail-under=65
|
[Unix] Create a framework for certbot integration tests: PART 4 (#6958)
This PR is the part 4 to implement #6541. It adds the integration tests for the nginx certbot plugin, and corresponds to the certbot-ci translation of certbot-nginx/tests/boulder-integration.sh that is executed for each PR.
As with certbot core tests, tests are written in Python, and executed by pytest, against a dynamic Boulder/Pebble instance setup. Tests are parallelized, of course, and a specific IntegrationTestsContext class, extended the one from certbot core tests, is crafter for these specific tests: its main goal is to setup a specific nginx instance for the current test.
On top of that, I use the test parametrization feature of Pytest, to drastically reduce the size of the actual code: indeed, the 6 tests from the original bash script share the same logic. So using a parametrization, one unique test is written, that is then executed 6 times against 6 different sets of parameters.
Note that the module integration_tests.nginx_tests.nginx_config do the same, but in Python, than certbot-nginx/tests/boulder-integration.conf.sh. The latter will be removed in a future PR, with all other bash scripts.
* Add nginx tests
* Distribute the other_port
* Load a pre-generated key/cert for nginx config
* Correct preload, remove a test, simplify a variable
* Integrate assertion directly in the test function
* Check process is not terminated
* Add spaces in the nginx config
* Add comments
* Use indirection
* Allow external cert
* Add coverage threshold for certbot-nginx
2019-04-23 16:29:48 -04:00
|
|
|
coverage report --include 'certbot-nginx/*' --show-missing --fail-under=74
|
2019-05-14 16:56:32 -04:00
|
|
|
passenv = DOCKER_*
|
|
|
|
|
|
2019-08-06 18:02:16 -04:00
|
|
|
[testenv:integration-certbot]
|
|
|
|
|
commands =
|
Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544)
Summary of changes in this PR:
- Refactor files involved in the `certbot` module to be of a similar structure to every other package; that is, inside a directory inside the main repo root (see below).
- Make repo root README symlink to `certbot` README.
- Pull tests outside of the distributed module.
- Make `certbot/tests` not be a module so that `certbot` isn't added to Python's path for module discovery.
- Remove `--pyargs` from test calls, and make sure to call tests from repo root since without `--pyargs`, `pytest` takes directory names rather than package names as arguments.
- Replace mentions of `.` with `certbot` when referring to packages to install, usually editably.
- Clean up some unused code around executing tests in a different directory.
- Create public shim around main and make that the entry point.
New directory structure summary:
```
repo root ("certbot", probably, but for clarity all files I mention are relative to here)
├── certbot
│ ├── setup.py
│ ├── certbot
│ │ ├── __init__.py
│ │ ├── achallenges.py
│ │ ├── _internal
│ │ │ ├── __init__.py
│ │ │ ├── account.py
│ │ │ ├── ...
│ │ ├── ...
│ ├── tests
│ │ ├── account_test.py
│ │ ├── display
│ │ │ ├── __init__.py
│ │ │ ├── ...
│ │ ├── ... # note no __init__.py at this level
│ ├── ...
├── acme
│ ├── ...
├── certbot-apache
│ ├── ...
├── ...
```
* refactor certbot/ and certbot/tests/ to use the same structure as the other packages
* git grep -lE "\-e(\s+)\." | xargs sed -i -E "s/\-e(\s+)\./-e certbot/g"
* git grep -lE "\.\[dev\]" | xargs sed -i -E "s/\.\[dev\]/certbot[dev]/g"
* git grep -lE "\.\[dev3\]" | xargs sed -i -E "s/\.\[dev3\]/certbot[dev3]/g"
* Remove replacement of certbot into . in install_and_test.py
* copy license back out to main folder
* remove linter_plugin.py and CONTRIBUTING.md from certbot/MANIFEST.in because these files are not under certbot/
* Move README back into main folder, and make the version inside certbot/ a symlink
* symlink certbot READMEs the other way around
* move testdata into the public api certbot zone
* update source_paths in tox.ini to certbot/certbot to find the right subfolder for tests
* certbot version has been bumped down a directory level
* make certbot tests directory not a package and import sibling as module
* Remove unused script cruft
* change . to certbot in test_sdists
* remove outdated comment referencing a command that doesn't work
* Install instructions should reference an existing file
* update file paths in Dockerfile
* some package named in tox.ini were manually specified, change those to certbot
* new directory format doesn't work easily with pyargs according to http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code
* remove other instance of pyargs
* fix up some references in _release.sh by searching for ' . ' and manual check
* another stray . in tox.ini
* fix paths in tools/_release.sh
* Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper
* Create public shim around main and make that the entry point
* without pyargs, tests cannot be run from an empty directory
* Remove cruft for running certbot directly from main
* Have main shim take real arg
* add docs/api file for main, and fix up main comment
* Update certbot/docs/install.rst
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
* Fix comments in readthedocs requirements files to refer to current package
* Update .[docs] reference in contributing.rst
* Move plugins tests to certbot tests directory
* add certbot tests to MANIFEST.in so packagers can run python setup.py test
* move examples directory inside certbot/
* Move CHANGELOG into certbot, and create a top-level symlink
* Remove unused sys and logging from main shim
* nginx http01 test no longer relies on certbot plugins common test
2019-11-25 17:28:06 -05:00
|
|
|
{[base]pip_install} acme certbot certbot-ci
|
2019-08-06 18:02:16 -04:00
|
|
|
pytest certbot-ci/certbot_integration_tests/certbot_tests \
|
|
|
|
|
--acme-server={env:ACME_SERVER:pebble} \
|
|
|
|
|
--cov=acme --cov=certbot --cov-report= \
|
|
|
|
|
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
|
|
|
|
|
coverage report --include 'certbot/*' --show-missing --fail-under=62
|
|
|
|
|
|
2020-11-17 03:27:27 -05:00
|
|
|
[testenv:integration-dns-rfc2136]
|
|
|
|
|
commands =
|
|
|
|
|
{[base]pip_install} acme certbot certbot-dns-rfc2136 certbot-ci
|
|
|
|
|
pytest certbot-ci/certbot_integration_tests/rfc2136_tests \
|
|
|
|
|
--acme-server=pebble --dns-server=bind \
|
2020-12-06 03:23:33 -05:00
|
|
|
--numprocesses=1 \
|
|
|
|
|
--cov=acme --cov=certbot --cov=certbot_dns_rfc2136 --cov-report= \
|
|
|
|
|
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
|
|
|
|
|
coverage report --include 'certbot/*' --show-missing --fail-under=45
|
2021-08-25 10:40:26 -04:00
|
|
|
coverage report --include 'certbot-dns-rfc2136/*' --show-missing --fail-under=86
|
2020-11-17 03:27:27 -05:00
|
|
|
|
2020-04-09 16:15:28 -04:00
|
|
|
[testenv:integration-external]
|
|
|
|
|
# Run integration tests with Certbot outside of tox's virtual environment.
|
|
|
|
|
commands =
|
|
|
|
|
{[base]pip_install} certbot-ci
|
|
|
|
|
pytest certbot-ci/certbot_integration_tests \
|
|
|
|
|
--acme-server={env:ACME_SERVER:pebble}
|
|
|
|
|
passenv = DOCKER_*
|
|
|
|
|
|
2019-05-14 16:56:32 -04:00
|
|
|
[testenv:integration-certbot-oldest]
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2019-05-14 16:56:32 -04:00
|
|
|
commands =
|
2021-06-01 17:46:06 -04:00
|
|
|
{[base]pip_install} acme certbot certbot-ci
|
2019-05-14 16:56:32 -04:00
|
|
|
pytest certbot-ci/certbot_integration_tests/certbot_tests \
|
|
|
|
|
--acme-server={env:ACME_SERVER:pebble}
|
|
|
|
|
passenv = DOCKER_*
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
setenv = {[testenv:oldest]setenv}
|
2019-05-14 16:56:32 -04:00
|
|
|
|
|
|
|
|
[testenv:integration-nginx-oldest]
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
basepython =
|
|
|
|
|
{[testenv:oldest]basepython}
|
2019-05-14 16:56:32 -04:00
|
|
|
commands =
|
2021-06-01 17:46:06 -04:00
|
|
|
{[base]pip_install} acme certbot certbot-nginx certbot-ci
|
2019-05-14 16:56:32 -04:00
|
|
|
pytest certbot-ci/certbot_integration_tests/nginx_tests \
|
|
|
|
|
--acme-server={env:ACME_SERVER:pebble}
|
|
|
|
|
passenv = DOCKER_*
|
Switch oldest tests to Python 3 (#8590)
Fixes https://github.com/certbot/certbot/issues/8580.
With this PR, it should now be possible to run the oldest tests natively on Linux, at least when using an older version of Python 3, which hasn't been possible in a long time. Unfortunately, this isn't possible on macOS which I opened https://github.com/certbot/certbot/issues/8589 to track.
You can see the full test suite running with these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=3283&view=results.
I took the version numbers for the packages I updated by searching for the oldest version of the dependency I think we should try and support based on the updated comments at the top of `oldest_constraints.txt`. While kind of annoying, I think it'd be a good idea for the reviewer to double check that I didn't make a mistake with the versions I used here.
To find these versions, I used https://packages.ubuntu.com, https://packages.debian.org, and a CentOS 7 Docker image with EPEL 7 installed. For the latter, not all packages are available in Python 3 yet (which is something Certbot's EPEL package maintainers are working on) and in that case I didn't worry about the system because I think they can/will package the newest version available. If they end up hitting any issues here when trying to package Certbot on Python 3, we can always work with them to fix it.
* remove py27 from oldest name
* update min cryptography version
* remove run_oldest_tests.sh
* upgrade setuptools and pyopenssl
* update cffi, pyparsing, and idna
* expand oldest_constraints comments
* clarify oldest comment
* update min configobj version
* update min parsedatetime version
* quote tox env name
* use Python 3.6 in the oldest tests
* use Python 3.6 for oldest integration tests
* properly pin asn1crypto
* update min six version
* set basepython for a nicer error message
* remove outdated python 2 oldest constraints
2021-01-25 15:59:14 -05:00
|
|
|
setenv = {[testenv:oldest]setenv}
|
2019-05-17 19:30:20 -04:00
|
|
|
|
2020-07-02 18:01:21 -04:00
|
|
|
[testenv:test-farm-tests-base]
|
2021-05-03 20:42:30 -04:00
|
|
|
changedir = letstest
|
|
|
|
|
# The package to install is in the current working directory because of the
|
|
|
|
|
# value of changedir.
|
|
|
|
|
commands = {[base]pip_install} .
|
2019-05-17 19:30:20 -04:00
|
|
|
passenv =
|
|
|
|
|
AWS_*
|
|
|
|
|
setenv = AWS_DEFAULT_REGION=us-east-1
|
|
|
|
|
|
2020-07-02 18:01:21 -04:00
|
|
|
[testenv:test-farm-apache2]
|
|
|
|
|
changedir = {[testenv:test-farm-tests-base]changedir}
|
2021-05-03 20:42:30 -04:00
|
|
|
commands =
|
|
|
|
|
{[testenv:test-farm-tests-base]commands}
|
|
|
|
|
{toxinidir}/tools/retry.sh letstest targets/apache2_targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir}
|
2020-07-02 18:01:21 -04:00
|
|
|
passenv = {[testenv:test-farm-tests-base]passenv}
|
|
|
|
|
setenv = {[testenv:test-farm-tests-base]setenv}
|
|
|
|
|
|
|
|
|
|
[testenv:test-farm-sdists]
|
|
|
|
|
changedir = {[testenv:test-farm-tests-base]changedir}
|
2021-05-03 20:42:30 -04:00
|
|
|
commands =
|
|
|
|
|
{[testenv:test-farm-tests-base]commands}
|
|
|
|
|
{toxinidir}/tools/retry.sh letstest targets/targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir}
|
2020-07-02 18:01:21 -04:00
|
|
|
passenv = {[testenv:test-farm-tests-base]passenv}
|
|
|
|
|
setenv = {[testenv:test-farm-tests-base]setenv}
|