From bb475843905af1a2d25b1f5834085c85c28bb175 Mon Sep 17 00:00:00 2001 From: Charles-Henri de Boysson Date: Thu, 18 Jun 2020 01:11:34 -0400 Subject: chore(tests): Add coverage report on codecov.io --- .travis.yml | 12 ++++++------ requirements_test.txt | 1 + tox.ini | 23 +++++++++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f74181..45059a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,17 +14,17 @@ language: python jobs: include: - python: '3.7' - env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py37-gevent-eventlet-sasl + env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py37-gevent-eventlet-sasl,codecov - python: '3.7' - env: ZOOKEEPER_VERSION=3.5.8 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py37-gevent-eventlet-sasl + env: ZOOKEEPER_VERSION=3.5.8 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py37-gevent-eventlet-sasl,codecov - python: '3.8' - env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py38-gevent-eventlet-sasl + env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py38-gevent-eventlet-sasl,codecov - python: '3.8' - env: ZOOKEEPER_VERSION=3.5.8 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py38-gevent-eventlet-sasl DEPLOY=true + env: ZOOKEEPER_VERSION=3.5.8 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py38-gevent-eventlet-sasl,codecov DEPLOY=true - python: 'pypy3' - env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=pypy3-gevent-eventlet-sasl + env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=pypy3-gevent-eventlet-sasl,codecov - python: 'pypy3' - env: ZOOKEEPER_VERSION=3.5.8 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=pypy3-gevent-eventlet-sasl + env: ZOOKEEPER_VERSION=3.5.8 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=pypy3-gevent-eventlet-sasl,codecov notifications: email: false install: diff --git a/requirements_test.txt b/requirements_test.txt index 06f6978..30f6df7 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -3,3 +3,4 @@ mock objgraph pytest pytest-cov +pytest-xdist diff --git a/tox.ini b/tox.ini index c2c4304..350c206 100644 --- a/tox.ini +++ b/tox.ini @@ -7,18 +7,17 @@ envlist = {gevent,eventlet,sasl,docs}, pypy3 -[testenv:pep8] -commands = flake8 {posargs} - [testenv] usedevelop = True install_command = pip install {opts} {packages} +passenv = + CI + TOX_* + TRAVIS + TRAVIS_* + ZOOKEEPER_* setenv = VIRTUAL_ENV={envdir} - ZOOKEEPER_VERSION={env:ZOOKEEPER_VERSION:} - ZOOKEEPER_PREFIX={env:ZOOKEEPER_PREFIX:} - ZOOKEEPER_SUFFIX={env:ZOOKEEPER_SUFFIX:} - ZOOKEEPER_LIB={env:ZOOKEEPER_LIB:} deps = -c{toxinidir}/constraints.txt -r{toxinidir}/requirements.txt @@ -28,10 +27,18 @@ deps = eventlet: -r{toxinidir}/requirements_eventlet.txt sasl: -r{toxinidir}/requirements_sasl.txt sasl: kerberos + codecov: codecov commands = sasl: {toxinidir}/init_krb5.sh {envtmpdir}/kerberos \ /{toxinidir}/ensure-zookeeper-env.sh \ - pytest {posargs: -ra -v --cov=kazoo kazoo/tests} + pytest {posargs: -ra -v --cov-report=xml --cov=kazoo kazoo/tests} + +[testenv:codecov] +commands = - codecov -e TOX_VENV,ZOOKEEPER_VERSION + +[testenv:pep8] +commands = flake8 {posargs} + [flake8] builtins = _ -- cgit v1.2.1