Giter Site home page Giter Site logo

danger-py-cov's Introduction

PyPI Python versions Build Status

danger-py-cov

The plugin parses the .xml coverage report and visualizes how the pull request affects the results.

Example output

Current coverage is 100.00%

Files changed Coverage -
calculations.py 100.00%
cobertura.py 100.00%
models.py 100.00%
plugin.py 100.00%
report.py 100.00%

Usage

Run the tests using the runner that supports XML reporting. For pytest and pytest-cov add following to the setup.cfg:

[tool:pytest]
addopts = --cov --cov-report xml:cov.xml --cov-report term

[coverage:run]
branch = True

Installation

# install danger-js
npm install -g danger
# install danger-python
pip install danger-python
# install danger-py-cov
pip install danger-py-cov
# modify dangerfile.py to include plugin
# run the tests with coverage report enabled
pytest --cov --cov-report xml:cov.xml --cov-report term
# run danger-python
danger-python pr https://github.com/elpassion/danger-py-cov/pull/2

Add following to the dangerfile.py:

import danger_py_cov

danger_py_cov.report_coverage("cov.xml", minimum_coverage=95.0)

Make sure to run pytest before running danger-python.

Development

To develop the new features, clone the repository and then run:

# install dependencies
poetry install 
# activate virtual environment
poetry shell 
# add pre-commit checks
pre-commit install -f -t pre-commit 
# run the test suite
pytest 

License

danger-py-cov is released under an MIT license. See LICENSE for more information.

danger-py-cov's People

Contributors

turekj avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.