From 0f8fdfd0e2a630c546086c221d3f0c984f65fdb8 Mon Sep 17 00:00:00 2001 From: Kevin Adler Date: Wed, 20 May 2020 18:51:05 -0500 Subject: [PATCH] ci: Add coverage report with Codecov.io Additionally, add pytest configuration to setup.cfg. Note that we can't add this configuration to pyproject.toml as it's not yet supported. See https://github.com/pytest-dev/pytest/issues/1556 --- .travis.yml | 8 +++++++- README.md | 6 ++++-- pyproject.toml | 1 + setup.cfg | 7 +++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe89b68..8bf5188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,12 +13,18 @@ matrix: - python: pypy3 - python: nightly -install: +before_install: - pip install --upgrade pip - pip install poetry + - pip install codecov + +install: - poetry install --no-root script: - pip install . - python -m pytest tests - python -m flake8 src + +after_success: + - python -m codecov diff --git a/README.md b/README.md index 65c8b58..cd86f18 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Python XMLSERVICE Toolkit [![Latest version released on PyPi](https://img.shields.io/pypi/v/itoolkit.svg)](https://pypi.python.org/pypi/itoolkit) [![](https://img.shields.io/pypi/pyversions/itoolkit.svg)](https://pypi.org/project/itoolkit/) [![Documentation Status](https://readthedocs.org/projects/python-itoolkit/badge/?version=latest)](https://python-itoolkit.readthedocs.io/en/latest/?badge=latest) +[![codecov](https://codecov.io/gh/IBM/python-itoolkit/branch/master/graph/badge.svg)](https://codecov.io/gh/IBM/python-itoolkit) + itoolkit is a Python interface to the [XMLSERVICE](https://github.com/IBM/xmlservice) toolkit for the [IBM i](https://en.wikipedia.org/wiki/IBM_i) platform. @@ -53,13 +55,13 @@ Tests To test the installed itoolkit ```bash -python -m pytest tests +python -m pytest ``` To test the local code: ```bash -PYTHONPATH=src python -m pytest tests +PYTHONPATH=src python -m pytest ``` Contributing diff --git a/pyproject.toml b/pyproject.toml index 1fc2b3e..61f9fd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ pytest-mock = ">=1.10.0" flake8 = ">=3.6.0" mock = "^3.0.5" bumpversion = "^0.5.0" +pytest-cov = "~2.8" [build-system] requires = ["poetry-core>=1.0.0a6"] diff --git a/setup.cfg b/setup.cfg index 15fc7e3..dcad2f1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,9 @@ [flake8] max-line-length = 80 + +[tool:pytest] +testpaths = + tests +addopts = + --cov=itoolkit + -r a