Skip to content

Commit d62d147

Browse files
afrozenatorcopybara-github
authored andcommitted
Activates coverage for Trax in OSS.
PiperOrigin-RevId: 308896581
1 parent f36e84f commit d62d147

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.coveragerc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[run]
2+
source =
3+
trax/
4+
omit =
5+
*_test.py
6+
*/site-packages/*
7+
8+
[report]
9+
omit =
10+
*/site-packages/*
11+
exclude_lines =
12+
pragma: no cover
13+
def __repr__
14+
raise NotImplementedError
15+
if __name__ == .__main__.:
16+

oss_scripts/oss_tests.sh

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
set -v # print commands as they're executed
1818

19+
# aliases aren't expanded in non-interactive shells by default.
20+
shopt -s expand_aliases
21+
1922
# Instead of exiting on any failure with "set -e", we'll call set_status after
2023
# each command and exit $STATUS at the end.
2124
STATUS=0
@@ -42,6 +45,9 @@ fi
4245
python -c "import trax"
4346
set_status
4447

48+
# Run pytest with coverage.
49+
alias pytest='coverage run -m pytest'
50+
4551
# Check tests, separate out directories for easy triage.
4652

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

110+
# Print coverage report.
111+
coverage report -m
112+
104113
exit $STATUS

0 commit comments

Comments
 (0)