Skip to content

Commit fd38c97

Browse files
committed
qa: code coverage reporting
1 parent ce119b0 commit fd38c97

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ language: python
22
python:
33
- "2.7"
44
- "3.6"
5+
- "3.7-dev"
56
install: make install-ci
67
script: make test-ci
8+
after_success:
9+
- make coverage-ci-codecov
710
notifications:
811
email: false

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test-tox:
9494
tox
9595

9696
.PHONY: test-ci
97-
test-ci: test-tox
97+
test-ci: test-tox coverage-ci
9898

9999
.PHONY: testimport
100100
testimport:
@@ -104,6 +104,27 @@ testimport:
104104
echo "OK"
105105

106106

107+
# =========================================
108+
# coverage (codecov)
109+
# --------------------------------------
110+
111+
.PHONY: coverage
112+
coverage: clean env3
113+
coverage run ./$(NAME)/tests
114+
115+
.PHONY: coverage-codecov
116+
coverage-codecov: coverage
117+
bash <(curl -s https://codecov.io/bash)
118+
119+
.PHONY: coverage-ci
120+
coverage-ci:
121+
coverage run ./$(NAME)/tests
122+
123+
.PHONY: coverage-ci-codecov
124+
coverage-ci-codecov:
125+
bash <(curl -s https://codecov.io/bash)
126+
127+
107128
# =========================================
108129
# environment (pyenv)
109130
# --------------------------------------

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Config2 [![PyPI version](https://badge.fury.io/py/config2.svg)](https://badge.fury.io/py/config2) [![Build Status](https://travis-ci.com/grimen/python-config2.svg?branch=master)](https://travis-ci.com/grimen/python-config2)
2+
# Config2 [![PyPI version](https://badge.fury.io/py/config2.svg)](https://badge.fury.io/py/config2) [![Build Status](https://travis-ci.com/grimen/python-config2.svg?branch=master)](https://travis-ci.com/grimen/python-config2) [![Coverage Status](https://codecov.io/gh/grimen/python-config2/branch/master/graph/badge.svg)](https://codecov.io/gh/grimen/python-config2)
33

44
*Python environment configuration simplified.*
55

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- "*/tests/*"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ six >= 1.11.0
88

99
colour-runner >= 0.0.5
1010
deepdiff >= 3.3.0
11-
pygments >= 2.2.0
1211
tox >= 3.0.0
12+
coverage >= 4.5.2
13+
codecov >= 2.0.15

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ envlist = py27, py36
44
skip_missing_interpreters = true
55

66
[testenv]
7-
commands = python ./config2/tests
8-
deps = -r requirements.txt
7+
commands = coverage run ./config2/tests
8+
commands_post = codecov -e TOXENV
9+
deps =
10+
-r requirements.txt
11+
passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_*

0 commit comments

Comments
 (0)