Skip to content

Commit cd145d7

Browse files
committed
Keep track of coverage of tests and combine at the end
1 parent aa3fbd2 commit cd145d7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/lint_and_test.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,21 @@ jobs:
111111
export OMP_NUM_THREADS=1
112112
# Get number of CPUs available
113113
N_CPU=$(nproc)
114+
coverage erase
114115
#echo "Running tests with max $N_CPU CPUs"
115116
# Run the tests with coverage
116-
PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -n auto -m "not benchmark" tests/io
117-
PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -n auto -m "not benchmark and not slow" tests/ml
117+
PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -n auto -m "not benchmark" tests/io --cov=atomworks --cov-append --cov-report= --no-cov-on-fail
118+
PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -n auto -m "not benchmark and not slow" tests/ml --cov=atomworks --cov-append --cov-report= --no-cov-on-fail
118119
#run slow test on 1 processor to limit memory usage
119-
PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -n 1 -m "not benchmark and slow" tests/ml
120+
PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -n 1 -m "not benchmark and slow" tests/ml --cov=atomworks --cov-append --cov-report= --no-cov-on-fail
120121
# Currently, running tests in different steps, so we do not go over memory limits
121122
# PDB_MIRROR_PATH=tests/data/pdb CCD_MIRROR_PATH=tests/data/ccd pytest -m "not benchmark" -n auto --maxprocesses=$N_CPU --dist=worksteal --cov=atomworks --cov-report=xml --cov-report=term --cov-report=term-missing tests/
122123
124+
# combine coverage
125+
coverage combine
126+
coverage report -m
127+
coverage xml -o coverage.xml
128+
123129
- name: Upload coverage report
124130
uses: actions/upload-artifact@v4
125131
with:

0 commit comments

Comments
 (0)