Skip to content

Commit

Permalink
Collecting coverage when running python tests (kubeflow#898)
Browse files Browse the repository at this point in the history
* Collecting coiverage when running python tests

* Added coveralls to python unit tests

* Try removing the PATH modification

* Specifying coverage run --source

* Using the installed package

* Try getting the correct coverage paths
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Aug 22, 2019
1 parent 553885f commit 593f25a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ matrix:
env: TOXENV=py35
script: &1
# Additional dependencies
- pip3 install jsonschema==3.0.1
- pip3 install coverage coveralls jsonschema==3.0.1
# DSL tests
- cd $TRAVIS_BUILD_DIR/sdk/python
- python3 setup.py install
- python3 tests/dsl/main.py
- python3 tests/compiler/main.py
- $TRAVIS_BUILD_DIR/sdk/python/tests/run_tests.sh
- python3 setup.py develop
- cd $TRAVIS_BUILD_DIR # Changing the current directory to the repo root for correct coverall paths
- coverage run --source=kfp --append sdk/python/tests/dsl/main.py
- coverage run --source=kfp --append sdk/python/tests/compiler/main.py
- coverage run --source=kfp --append -m unittest discover --verbose --start-dir sdk/python/tests --top-level-directory=sdk/python
- coveralls

# Visualization test
- cd $TRAVIS_BUILD_DIR/backend/src/apiserver/visualization
Expand Down
1 change: 0 additions & 1 deletion sdk/python/tests/components/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import unittest
from pathlib import Path

sys.path.insert(0, __file__ + '/../../../')

import kfp
import kfp.components as comp
Expand Down
1 change: 0 additions & 1 deletion sdk/python/tests/components/test_graph_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import unittest
from pathlib import Path

sys.path.insert(0, __file__ + '/../../../')

import kfp.components as comp
from kfp.components._structures import ComponentReference, ComponentSpec, ContainerSpec, GraphInputArgument, GraphSpec, InputSpec, InputValuePlaceholder, GraphImplementation, OutputPathPlaceholder, OutputSpec, TaskOutputArgument, TaskSpec
Expand Down

0 comments on commit 593f25a

Please sign in to comment.