Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Measure coverage
Browse files Browse the repository at this point in the history
Enable measuring code coverage, and publish the results to Coveralls.

Fail the unit tests, if coverage drops bellow the current level.

`tests/__init__.py` had to be added, otherwise no code coverage data
was collected (some strange behaviour of pytest-cov or some underlying
library).

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
  • Loading branch information
Hunor Csomortáni authored and MartinBasti committed Feb 25, 2019
1 parent 0df0344 commit b4dd705
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ matrix:
python: "3.6"
- dist: xenial
python: "3.7"
install: pip install tox-travis
install: pip install tox-travis coveralls
script: tox
after_success: coveralls
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Operators Manifests Push Service (OMPS)

[![Build Status](https://travis-ci.com/release-engineering/operators-manifests-push-service.svg?branch=master)](https://travis-ci.com/release-engineering/operators-manifests-push-service)
[![Coverage Status](https://coveralls.io/repos/github/release-engineering/operators-manifests-push-service/badge.svg?branch=master)](https://coveralls.io/github/release-engineering/operators-manifests-push-service?branch=master)

Service for pushing operators manifests to quay.io from various sources.

## Settings
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
extras_require={
'test': [
'pytest',
'pytest-cov',
'requests-mock',
'flexmock',
],
Expand Down
Empty file added tests/__init__.py
Empty file.
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[tox]
envlist = py36,py37


[testenv]
deps = .[test]
commands = pytest --cov=omps tests/

commands = py.test tests/
[coverage:report]
fail_under = 87

0 comments on commit b4dd705

Please sign in to comment.