Skip to content

Commit 665abc1

Browse files
committed
[SYSTEMDS-3776] Code coverage in GitHub Actions (Python)
This commit hopefully adds code coverage for the Python API. It should activate after merging to main. Closes #2263
1 parent c3ac73c commit 665abc1

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/workflows/javaTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
run: mvn jacoco:report
148148

149149
- name: Upload coverage to Codecov
150-
uses: codecov/codecov-action@v4
150+
uses: codecov/codecov-action@v4.2.0
151151
if: github.repository_owner == 'apache'
152152
with:
153153
fail_ci_if_error: false

.github/workflows/python.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ jobs:
128128
export SYSDS_QUIET=1
129129
export LOG4JPROP=$SYSTEMDS_ROOT/src/test/resources/log4j.properties
130130
cd src/main/python
131-
unittest-parallel -t . -s tests -v
131+
unittest-parallel -t . -s tests -v --coverage-branch --coverage-xml .coverage.xml --coverage-source systemds
132132
# python -m unittest discover -s tests -p 'test_*.py'
133133
echo "Exit Status: " $?
134134
135135
- name: Run all python tests no environment
136136
run: |
137137
export LOG4JPROP=$(pwd)/src/test/resources/log4j.properties
138138
cd src/main/python
139-
unittest-parallel -t . -s tests -v
139+
unittest-parallel -t . -s tests -v --coverage-branch --coverage-xml .coverage.xml --coverage-source systemds
140140
# python -m unittest discover -s tests -p 'test_*.py'
141141
echo "Exit Status: " $?
142142
@@ -154,3 +154,11 @@ jobs:
154154
- name: Check formatting according to Black (src/main/python/tests)
155155
run: |
156156
black --check src/main/python/tests
157+
158+
- name: Upload coverage to Codecov
159+
uses: codecov/[email protected]
160+
if: github.repository_owner == 'apache'
161+
env:
162+
fail_ci_if_error: false
163+
files: src/main/python/.coverage.xml
164+
token: ${{ secrets.CODECOV_TOKEN }}

src/main/python/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@ systemds/SystemDS.jar
5252

5353
# tutorial
5454
systemds/examples/tutorials/*
55+
56+
# test coverage
57+
.coverage
58+
.coverage.xml
59+

0 commit comments

Comments
 (0)