diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index 53bc0b5dd..29afa2a98 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -14,7 +14,7 @@ jobs: windows-py37: IMAGE_NAME: windows-2019 PYTHON_VERSION: 3.7 - TOXENV: py37-win + TOXENV: py-win windows-py39-cover: IMAGE_NAME: windows-2019 PYTHON_VERSION: 3.9 diff --git a/tools/install_and_test.py b/tools/install_and_test.py deleted file mode 100755 index 439e5dce3..000000000 --- a/tools/install_and_test.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# 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. Packages are installed using -# pinned versions of all of our dependencies. See pip_install.py for more -# information on the versions pinned to. -import os -import re -import subprocess -import sys - - -def call_with_print(command): - print(command) - subprocess.check_call(command, shell=True) - - -def main(args): - script_dir = os.path.dirname(os.path.abspath(__file__)) - command = [sys.executable, os.path.join(script_dir, 'pip_install_editable.py')] - - for requirement in args: - current_command = command[:] - current_command.append(requirement) - call_with_print(' '.join(current_command)) - pkg = re.sub(r'\[\w+\]', '', requirement) - - call_with_print(' '.join([ - sys.executable, '-m', 'pytest', pkg])) - -if __name__ == '__main__': - main(sys.argv[1:]) diff --git a/tools/pip_install_editable.py b/tools/pip_install_editable.py deleted file mode 100755 index 87be1b8f5..000000000 --- a/tools/pip_install_editable.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python -# pip installs packages in editable mode using pip_install.py -import sys - -import pip_install - - -def main(args): - new_args = [] - for arg in args: - new_args.append('-e') - new_args.append(arg) - - pip_install.main(new_args) - -if __name__ == '__main__': - main(sys.argv[1:]) diff --git a/tox.ini b/tox.ini index 6a7d44969..8e8f78466 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,7 @@ commands = echo "Unrecognized environment name {envname}" false -[testenv:py] +[testenv:py{,-win,-posix}] commands = python -m pytest {posargs} acme certbot certbot-apache certbot-dns-cloudflare 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 certbot-nginx @@ -79,6 +79,25 @@ deps = -e certbot-ci commands = mypy {[base]source_paths} +[testenv:isolated-acme] +description = Tests acme without any Certbot components installed +deps = -e acme[test] +commands = python -m pytest acme + +[testenv:isolated-certbot] +description = Tests Certbot without any additional plugins installed +deps = + {[testenv:isolated-acme]deps} + -e certbot[test] +commands = python -m pytest certbot + +[testenv:isolated-plugin] +description = Tests the given plugin without installing other plugins +deps = + {[testenv:isolated-certbot]deps} + -e {posargs} +commands = python -m pytest {posargs} + [testenv:apacheconftest] deps = -e acme @@ -139,7 +158,7 @@ passenv = DOCKER_* [testenv:docker_dev] -description = tests the Dockerfile-dev file to ensure development with it works as expected +description = Tests the Dockerfile-dev file to ensure development with it works as expected deps = commands = docker-compose run --rm --service-ports development bash -c 'tox -e lint' @@ -230,7 +249,5 @@ passenv = AWS_* setenv = AWS_DEFAULT_REGION=us-east-1 changedir = letstest -# The package to install is in the current working directory because of the -# value of changedir. -deps = -e . +deps = -e {toxinidir}/letstest commands = {toxinidir}/tools/retry.sh letstest targets/targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir}