Consolidate cover envs and default to py3-cover (#7905)

* Consolidate cover envs and default to py3-cover

* use py38 for code coverage in Travis

* Disable coverage on Python < 3.6 line.
This commit is contained in:
Brad Warren
2020-04-16 08:59:40 -07:00
committed by GitHub
parent f66314926a
commit 859dc38cb9
3 changed files with 12 additions and 23 deletions
+5 -5
View File
@@ -44,8 +44,8 @@ matrix:
<<: *not-on-master <<: *not-on-master
# This job is always executed, including on master # This job is always executed, including on master
- python: "2.7" - python: "3.8"
env: TOXENV=py27-cover FYI="py27 tests + code coverage" env: TOXENV=py38-cover FYI="py38 tests + code coverage"
- python: "3.7" - python: "3.7"
env: TOXENV=lint env: TOXENV=lint
@@ -60,12 +60,12 @@ matrix:
dist: trusty dist: trusty
env: TOXENV='py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest' env: TOXENV='py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest'
<<: *not-on-master <<: *not-on-master
- python: "2.7"
env: TOXENV=py27
<<: *not-on-master
- python: "3.5" - python: "3.5"
env: TOXENV=py35 env: TOXENV=py35
<<: *not-on-master <<: *not-on-master
- python: "3.8"
env: TOXENV=py38
<<: *not-on-master
- sudo: required - sudo: required
env: TOXENV=apache_compat env: TOXENV=apache_compat
services: docker services: docker
@@ -741,7 +741,7 @@ class ApacheParser(object):
""" """
if sys.version_info < (3, 6): if sys.version_info < (3, 6):
# This strips off final /Z(?ms) # This strips off final /Z(?ms)
return fnmatch.translate(clean_fn_match)[:-7] return fnmatch.translate(clean_fn_match)[:-7] # pragma: no cover
# Since Python 3.6, it returns a different pattern like (?s:.*\.load)\Z # Since Python 3.6, it returns a different pattern like (?s:.*\.load)\Z
return fnmatch.translate(clean_fn_match)[4:-3] # pragma: no cover return fnmatch.translate(clean_fn_match)[4:-3] # pragma: no cover
+6 -17
View File
@@ -4,7 +4,7 @@
[tox] [tox]
skipsdist = true skipsdist = true
envlist = modification,py3,py27-cover,lint,mypy envlist = modification,py3-cover,lint,mypy
[base] [base]
# pip installs the requested packages in editable mode # pip installs the requested packages in editable mode
@@ -63,8 +63,11 @@ source_paths =
passenv = passenv =
CERTBOT_NO_PIN CERTBOT_NO_PIN
commands = commands =
{[base]install_and_test} {[base]all_packages} !cover: {[base]install_and_test} {[base]all_packages}
python tests/lock_test.py !cover: python tests/lock_test.py
cover: {[base]install_packages}
cover: {[base]pip_install} certbot-apache[dev]
cover: python tox.cover.py
# We always recreate the virtual environment to avoid problems like # We always recreate the virtual environment to avoid problems like
# https://github.com/certbot/certbot/issues/7745. # https://github.com/certbot/certbot/issues/7745.
recreate = true recreate = true
@@ -116,20 +119,6 @@ commands =
setenv = setenv =
{[testenv:py27-oldest]setenv} {[testenv:py27-oldest]setenv}
[testenv:py27-cover]
basepython = python2.7
commands =
{[base]install_packages}
{[base]pip_install} certbot-apache[dev]
python tox.cover.py
[testenv:py37-cover]
basepython = python3.7
commands =
{[base]install_packages}
{[base]pip_install} certbot-apache[dev]
python tox.cover.py
[testenv:lint] [testenv:lint]
basepython = python3 basepython = python3
# separating into multiple invocations disables cross package # separating into multiple invocations disables cross package