Skip to content

Commit 6a74d07

Browse files
iquinterowinstonaws
authored andcommitted
Enforce 90% Code Coverage for Unit Tests. (#97)
* Enforce 90% Code Coverage for Unit Tests. * Ignore tensorflow-serving in CodeCov * Add Build and Coverage Badges * Change the way we ignore coverage. For the integration tests we are not interested in holding the 90% coverage bar. Since we run them in isolation it doesn't report coverage correctly and even setting a low threshold will fail the build. If we set IGNORE_COVERAGE=- then the exit code of coverage result will be ignored.
1 parent 816176f commit 6a74d07

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- "**/tensorflow/tensorflow_serving/.*"

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: python
22
python:
33
- '2.7'
44
- '3.5'
5-
install: pip install tox-travis
5+
install: pip install tox-travis codecov
66
script:
77
- tox tests/unit
8+
after_success:
9+
- codecov
10+

README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
SageMaker Python SDK
77
====================
88

9+
.. image:: https://travis-ci.org/aws/sagemaker-python-sdk.svg?branch=master
10+
:target: https://travis-ci.org/aws/sagemaker-python-sdk
11+
:alt: Build Status
12+
13+
.. image:: https://codecov.io/gh/aws/sagemaker-python-sdk/branch/master/graph/badge.svg
14+
:target: https://codecov.io/gh/aws/sagemaker-python-sdk
15+
:alt: CodeCov
16+
917
SageMaker Python SDK is an open source library for training and deploying machine learning models on Amazon SageMaker.
1018

1119
With the SDK, you can train and deploy models using popular deep learning frameworks: **Apache MXNet** and **TensorFlow**. You can also train and deploy models with **Amazon algorithms**, these are scalable implementations of core machine learning algorithms that are optimized for SageMaker and GPU training. If you have **your own algorithms** built into SageMaker compatible Docker containers, you can train and host models using these as well.

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ passenv =
3535
# {posargs} can be passed in by additional arguments specified when invoking tox.
3636
# Can be used to specify which tests to run, e.g.: tox -- -s
3737
commands =
38-
pytest {posargs}
38+
coverage run --source sagemaker -m py.test {posargs}
39+
{env:IGNORE_COVERAGE:} coverage report --fail-under=90 --omit */tensorflow/tensorflow_serving/*
3940
deps =
4041
pytest
4142
pytest-cov

0 commit comments

Comments
 (0)