Skip to content

Commit b3add5d

Browse files
authored
Code coverage report to codeclimate [ch3045] (#27)
* Code coverage report to codeclimate [ch3045] * httpretty * tr -i * format settings * bash way * it requires xml, ok * restrict coverage report
1 parent b106d47 commit b3add5d

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

.travis.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,23 @@ python:
66
- "3.5"
77
- "3.6"
88

9-
# command to install dependencies
10-
install: "pip install -r requirements.txt"
9+
install:
10+
- pip install -r requirements.txt
11+
- pip install coverage
12+
13+
before_script:
14+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
15+
- chmod +x ./cc-test-reporter
16+
- ./cc-test-reporter before-build
1117

1218
# command to run tests
13-
script: python setup.py test
19+
script: coverage run ./setup.py test && coverage xml -i --include='chartmogul/*'
20+
21+
after_script:
22+
- function unzip_egg { mv $1 tmp.zip && unzip tmp.zip -d $1; }
23+
- unzip_egg .eggs/PyYAML-5.1.2-py2.7-linux-x86_64.egg
24+
- unzip_egg .eggs/wrapt-1.11.2-py2.7-linux-x86_64.egg
25+
- ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT
1426

1527
branches:
1628
only:

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@
2020
'marshmallow>=2.12.1',
2121
'future>=0.16.0',
2222
]
23-
test_requirements = ['mock>=1.0.1', 'requests-mock>=1.3.0', 'vcrpy>=1.11.1', 'httpretty>=0.9.5']
23+
test_requirements = [
24+
'mock>=1.0.1',
25+
'requests-mock>=1.3.0',
26+
'vcrpy>=1.11.1',
27+
'httpretty>=0.9.5',
28+
'PyYAML>=5.1.2',
29+
'httpretty>=0.9.6',
30+
'wrapt>=1.11.2'
31+
]
2432

2533
with open('chartmogul/__init__.py', 'r') as fd:
2634
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',

0 commit comments

Comments
 (0)