Skip to content

Commit

Permalink
[SYSTEMDS-3776] Code coverage in GitHub Actions (Python)
Browse files Browse the repository at this point in the history
This commit hopefully adds code coverage for the
Python API. It should activate after merging to
main.

Closes #2263
  • Loading branch information
Baunsgaard committed Sep 28, 2024
1 parent c3ac73c commit 665abc1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/javaTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
run: mvn jacoco:report

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v4.2.0
if: github.repository_owner == 'apache'
with:
fail_ci_if_error: false
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ jobs:
export SYSDS_QUIET=1
export LOG4JPROP=$SYSTEMDS_ROOT/src/test/resources/log4j.properties
cd src/main/python
unittest-parallel -t . -s tests -v
unittest-parallel -t . -s tests -v --coverage-branch --coverage-xml .coverage.xml --coverage-source systemds
# python -m unittest discover -s tests -p 'test_*.py'
echo "Exit Status: " $?
- name: Run all python tests no environment
run: |
export LOG4JPROP=$(pwd)/src/test/resources/log4j.properties
cd src/main/python
unittest-parallel -t . -s tests -v
unittest-parallel -t . -s tests -v --coverage-branch --coverage-xml .coverage.xml --coverage-source systemds
# python -m unittest discover -s tests -p 'test_*.py'
echo "Exit Status: " $?
Expand All @@ -154,3 +154,11 @@ jobs:
- name: Check formatting according to Black (src/main/python/tests)
run: |
black --check src/main/python/tests
- name: Upload coverage to Codecov
uses: codecov/[email protected]
if: github.repository_owner == 'apache'
env:
fail_ci_if_error: false
files: src/main/python/.coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 5 additions & 0 deletions src/main/python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ systemds/SystemDS.jar

# tutorial
systemds/examples/tutorials/*

# test coverage
.coverage
.coverage.xml

0 comments on commit 665abc1

Please sign in to comment.