Skip to content

Commit

Permalink
Make coverage reports more accurate. (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
aadyotb authored Jun 18, 2022
1 parent 5a322ca commit 251f4e9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ jobs:
- name: Test with pytest
id: test
run: |
# Get a comma-separated list of the directories of all python source files
source_files=$(for f in $(find merlion -iname "*.py"); do echo -n ",$f"; done)
script="import os; print(','.join({os.path.dirname(f) for f in '$source_files'.split(',') if f}))"
source_modules=$(python -c "$script")
# A BLAS bug causes high-dim multivar Bayesian LR test to segfault in 3.6. Run the test first to avoid.
if [[ $PYTHON_VERSION == 3.6 ]]; then
python -m pytest -v tests/change_point/test_conj_prior.py
coverage run --source=merlion/ -L -m pytest -v --ignore tests/change_point/test_conj_prior.py
coverage run --source=${source_modules} -L -m pytest -v --ignore tests/change_point/test_conj_prior.py
else
coverage run --source=merlion/ -L -m pytest -v
coverage run --source=${source_modules} -L -m pytest -v
fi
# Obtain code coverage from coverage report
Expand Down

0 comments on commit 251f4e9

Please sign in to comment.