Skip to content

Commit

Permalink
Coverage support (demisto#307)
Browse files Browse the repository at this point in the history
* enable coverage

* circleci with coverage

* add coveralls

* add coveralls. fix yml

* fix badge to point to master

Co-authored-by: Bar Katzir <[email protected]>
  • Loading branch information
glicht and bakatzir authored Mar 28, 2020
1 parent af959a8 commit fb12474
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ jobs:
name: tox build
command: |
pip install tox
tox -v demisto_sdk
tox -e py37 -v -- --cov=demisto_sdk --cov-report=html
tox -e py38 -v
- run:
name: pre-commit
command: |
. .tox/py37/bin/activate
pre-commit --version
pre-commit run -a
deactivate
- store_artifacts:
path: coverage_html_report
- run:
name: coveralls upload
command: |
pip install coveralls
coveralls
- run:
name: deploy
command: |
Expand Down
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
omit =
**/tests/**
**/__init__.py

[html]
directory = coverage_html_report
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ git_push.sh
.pytest_cache
.idea
.mypy_cache
coverage_html_report
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![PyPI version](https://badge.fury.io/py/demisto-sdk.svg)](https://badge.fury.io/py/demisto-sdk)
[![CircleCI](https://circleci.com/gh/demisto/demisto-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/demisto/demisto-sdk/tree/master)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/ppwwyyxx/OpenPano.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/demisto/demisto-sdk/context:python)
[![Coverage Status](https://coveralls.io/repos/github/demisto/demisto-sdk/badge.svg?branch=coverage)](https://coveralls.io/github/demisto/demisto-sdk?branch=coverage)
[![Coverage Status](https://coveralls.io/repos/github/demisto/demisto-sdk/badge.svg)](https://coveralls.io/github/demisto/demisto-sdk)

# Demisto SDK

Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --ignore=demisto_sdk/commands/init/templates
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mock
pre-commit
pytest
pytest-cov
pytest-mock
requests_mock
tox-pyenv
Expand Down
10 changes: 2 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
[tox]
envlist = py37,py38,flake8,mypy
envlist = py37,py38,mypy

[testenv]
passenv = *
deps = -r {toxinidir}/requirements.txt
-r {toxinidir}/requirements-dev.txt
commands = pytest -p no:warnings -v {posargs} --ignore=demisto_sdk/commands/init/templates

[testenv:flake8]
basepython = python3
skip_install = true
deps = flake8
commands = flake8 demisto_sdk/ setup.py
commands = pytest -p no:warnings -v {posargs}

[testenv:mypy]
basepython = python3
Expand Down

0 comments on commit fb12474

Please sign in to comment.