Skip to content

Commit

Permalink
Activates coverage for Trax in OSS.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 308896581
  • Loading branch information
afrozenator authored and copybara-github committed Apr 28, 2020
1 parent f36e84f commit d62d147
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]
source =
trax/
omit =
*_test.py
*/site-packages/*

[report]
omit =
*/site-packages/*
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
if __name__ == .__main__.:

9 changes: 9 additions & 0 deletions oss_scripts/oss_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

set -v # print commands as they're executed

# aliases aren't expanded in non-interactive shells by default.
shopt -s expand_aliases

# Instead of exiting on any failure with "set -e", we'll call set_status after
# each command and exit $STATUS at the end.
STATUS=0
Expand All @@ -42,6 +45,9 @@ fi
python -c "import trax"
set_status

# Run pytest with coverage.
alias pytest='coverage run -m pytest'

# Check tests, separate out directories for easy triage.

# Disabled test fails with "disable-warnings", tested separately.
Expand Down Expand Up @@ -101,4 +107,7 @@ jupyter nbconvert --ExecutePreprocessor.kernel_name=python3 \
trax/intro.ipynb;
set_status

# Print coverage report.
coverage report -m

exit $STATUS

0 comments on commit d62d147

Please sign in to comment.