diff --git a/.travis.yml b/.travis.yml index 9d3ac87f0..1482dfe63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ cache: before_script: - 'if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ulimit -n 1024 ; fi' - # On Travis, the fastest parallelization for integration tests is proved to be 4. + # On Travis, the fastest parallelization for integration tests has proved to be 4. - 'if [[ "$TOXENV" == *"integration"* ]]; then export PYTEST_ADDOPTS="--numprocesses 4"; fi' - export TOX_TESTENV_PASSENV=TRAVIS @@ -110,13 +110,9 @@ matrix: <<: *extended-test-suite - python: "2.7" env: TOXENV=py27-certbot-oldest - sudo: required - services: docker <<: *extended-test-suite - python: "2.7" env: TOXENV=py27-nginx-oldest - sudo: required - services: docker <<: *extended-test-suite - python: "2.7" env: ACME_SERVER=boulder-v1 TOXENV=integration-certbot-oldest @@ -139,44 +135,57 @@ matrix: services: docker <<: *extended-test-suite - python: "3.4" - env: ACME_SERVER=boulder-v1 TOXENV=py34,integration + env: TOXENV=py34 + <<: *extended-test-suite + - python: "3.5" + env: TOXENV=py35 + <<: *extended-test-suite + - python: "3.6" + env: TOXENV=py36 + <<: *extended-test-suite + - python: "3.7" + dist: xenial + env: TOXENV=py37 + <<: *extended-test-suite + - python: "3.4" + env: ACME_SERVER=boulder-v1 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.4" - env: ACME_SERVER=boulder-v2 TOXENV=py34,integration + env: ACME_SERVER=boulder-v2 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.5" - env: ACME_SERVER=boulder-v1 TOXENV=py35,integration + env: ACME_SERVER=boulder-v1 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.5" - env: ACME_SERVER=boulder-v2 TOXENV=py35,integration + env: ACME_SERVER=boulder-v2 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.6" - env: ACME_SERVER=boulder-v1 TOXENV=py36,integration + env: ACME_SERVER=boulder-v1 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.6" - env: ACME_SERVER=boulder-v2 TOXENV=py36,integration + env: ACME_SERVER=boulder-v2 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.7" dist: xenial - env: ACME_SERVER=boulder-v1 TOXENV=py37,integration + env: ACME_SERVER=boulder-v1 TOXENV=integration sudo: required services: docker <<: *extended-test-suite - python: "3.7" dist: xenial - env: ACME_SERVER=boulder-v2 TOXENV=py37,integration + env: ACME_SERVER=boulder-v2 TOXENV=integration sudo: required services: docker <<: *extended-test-suite diff --git a/certbot-ci/certbot_integration_tests/utils/pytest_plugin.py b/certbot-ci/certbot_integration_tests/conftest.py similarity index 90% rename from certbot-ci/certbot_integration_tests/utils/pytest_plugin.py rename to certbot-ci/certbot_integration_tests/conftest.py index aab9d138b..892c16266 100644 --- a/certbot-ci/certbot_integration_tests/utils/pytest_plugin.py +++ b/certbot-ci/certbot_integration_tests/conftest.py @@ -18,9 +18,10 @@ def pytest_addoption(parser): Standard pytest hook to add options to the pytest parser. :param parser: current pytest parser that will be used on the CLI """ - parser.addoption('--acme-server', + parser.addoption('--acme-server', default='pebble', choices=['boulder-v1', 'boulder-v2', 'pebble'], - help='select the ACME server to use (boulder-v1, boulder-v2, pebble)') + help='select the ACME server to use (boulder-v1, boulder-v2, ' + 'pebble), defaulting to pebble') def pytest_configure(config): @@ -28,8 +29,7 @@ def pytest_configure(config): Standard pytest hook used to add a configuration logic for each node of a pytest run. :param config: the current pytest configuration """ - acme_server = config.option.acme_server if hasattr(config.option, 'acme_server') else None - if not hasattr(config, 'slaveinput') and acme_server: # If true, this is the primary node + if not hasattr(config, 'slaveinput'): # If true, this is the primary node with _print_on_err(): config.acme_xdist = _setup_primary_node(config) @@ -39,8 +39,7 @@ def pytest_configure_node(node): Standard pytest-xdist hook used to configure a worker node. :param node: current worker node """ - if hasattr(node.config, 'acme_xdist'): - node.slaveinput['acme_xdist'] = node.config.acme_xdist + node.slaveinput['acme_xdist'] = node.config.acme_xdist @contextlib.contextmanager diff --git a/certbot-ci/local-oldest-requirements.txt b/certbot-ci/local-oldest-requirements.txt deleted file mode 100644 index 09d6eed1a..000000000 --- a/certbot-ci/local-oldest-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Even if only pyparsing 1.5.6 is available on CentOS 6, version 2.0.2 is required -# to make pytest plugins auto-discovery working. No breaking change is done from 1.5.6 -# besides removal of support to Python < 2.6, that is irrelevant for oldest tests. -pyparsing==2.0.2 diff --git a/certbot-ci/pytest.ini b/certbot-ci/pytest.ini new file mode 100644 index 000000000..e69de29bb diff --git a/certbot-ci/setup.py b/certbot-ci/setup.py index 28765dc12..9bbd18022 100644 --- a/certbot-ci/setup.py +++ b/certbot-ci/setup.py @@ -46,9 +46,4 @@ setup( packages=find_packages(), include_package_data=True, install_requires=install_requires, - entry_points={ - 'pytest11': [ - 'acme-xdist = certbot_integration_tests.utils.pytest_plugin' - ] - } ) diff --git a/tox.ini b/tox.ini index 24050041a..7f2c18d38 100644 --- a/tox.ini +++ b/tox.ini @@ -249,20 +249,19 @@ passenv = DOCKER_* [testenv:integration] commands = {[base]pip_install} acme . certbot-nginx certbot-ci - pytest --pyargs certbot_integration_tests \ + pytest certbot-ci/certbot_integration_tests \ --acme-server={env:ACME_SERVER:pebble} \ --cov=acme --cov=certbot --cov=certbot_nginx --cov-report= \ - --cov-config={toxinidir}/certbot-ci/certbot_integration_tests/.coveragerc + --cov-config=certbot-ci/certbot_integration_tests/.coveragerc coverage report --include 'certbot/*' --show-missing --fail-under=67 coverage report --include 'certbot-nginx/*' --show-missing --fail-under=74 passenv = DOCKER_* -setenv = {[testenv]setenv} [testenv:integration-certbot-oldest] commands = {[base]pip_install} . {[base]pip_install} certbot-ci - pytest --pyargs certbot_integration_tests.certbot_tests \ + pytest certbot-ci/certbot_integration_tests/certbot_tests \ --acme-server={env:ACME_SERVER:pebble} passenv = DOCKER_* setenv = {[testenv:py27-oldest]setenv} @@ -271,7 +270,7 @@ setenv = {[testenv:py27-oldest]setenv} commands = {[base]pip_install} certbot-nginx {[base]pip_install} certbot-ci - pytest --pyargs certbot_integration_tests.nginx_tests \ + pytest certbot-ci/certbot_integration_tests/nginx_tests \ --acme-server={env:ACME_SERVER:pebble} passenv = DOCKER_* setenv = {[testenv:py27-oldest]setenv}