Skip to content

Commit

Permalink
Set up code coverage report (sql-machine-learning#1327)
Browse files Browse the repository at this point in the history
* Add coverage report

Signed-off-by: terrytangyuan <[email protected]>

* Remove empty line

Signed-off-by: terrytangyuan <[email protected]>
  • Loading branch information
terrytangyuan authored and ywskycn committed Oct 18, 2019
1 parent eb93e2a commit aab4e1c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "0...100"

status:
project: yes
patch: yes
changes: no

ignore:
- "elasticdl/python/tests"

comment: false
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ jobs:
name: "Unit Tests"
script:
- docker build -t elasticdl:dev -f elasticdl/docker/Dockerfile.dev .
# Create shared folder to store coverage report
- mkdir shared
# Run unit tests without k8s or ODPS
- docker run --rm -it -v $PWD:/work -w /work elasticdl:dev bash -c "make -f elasticdl/Makefile && K8S_TESTS=False pytest elasticdl/python/tests --cov=elasticdl/python"
- docker run --rm -it -v $PWD/shared:/shared -v $PWD:/work -w /work elasticdl:dev bash -c "make -f elasticdl/Makefile && K8S_TESTS=False pytest elasticdl/python/tests --cov=elasticdl/python --cov-report=xml; mv coverage.xml shared"
# Report code coverage to https://codecov.io
- bash <(curl -s https://codecov.io/bash)
# Run unit tests related to ODPS
- |
if [ "$ODPS_ACCESS_ID" == "" ] || [ "$ODPS_ACCESS_KEY" == "" ]; then
Expand Down Expand Up @@ -77,9 +81,9 @@ branches:
- develop
- "/branch-\\d+\\.\\d+(\\.\\d+)?(-\\S*)?$/"

# Secure tokens for ODPS-related environment variables
env:
global:
# Secure tokens for ODPS-related environment variables
- secure: kr79IltMhuW+pmmdP0KBMY87+iePGBGiaOUYTZhxx3zW3a1t2xK5wJnxJvrOwgBipqxLvIQnYUu20Lwfo0I2bwPRVvZAExb1v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HN+++swP+x1pPsC6iJ8KluZ6iSx6andHGnLyzvltaPqXxR8KNmfhDKXCcX8U/OPN1v22irdyAqWrZe7geNNVZJF1BRMEby1UYmAVZyZJ8xfhod/Acpv3Di+ZKSGGhbKvt20J1oYpVsV5lcNGAuCLgd175HHgkpFfjGuw97rRberBgCwzQdrRJjSvgsSp7VPjzOnrAE=
- ODPS_PROJECT_NAME=gomaxcompute_driver_w7u
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ElasticDL: A Kubernetes-native Deep Learning Framework

[![Travis-CI Build Status](https://travis-ci.org/sql-machine-learning/elasticdl.svg?branch=develop)](https://travis-ci.org/sql-machine-learning/elasticdl)
[![Code Coverage](https://codecov.io/gh/sql-machine-learning/elasticdl/branch/develop/graph/badge.svg)](https://codecov.io/gh/sql-machine-learning/elasticdl)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![PyPI Status Badge](https://badge.fury.io/py/elasticdl.svg)](https://pypi.org/project/elasticdl/)

Expand Down

0 comments on commit aab4e1c

Please sign in to comment.