This is an automated email from the ASF dual-hosted git repository. baunsgaard pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/systemds.git
commit 665abc19afe55717dda1315d77f00a0d652b132a Author: Sebastian Baunsgaard <baunsga...@apache.org> AuthorDate: Sat Sep 28 21:31:55 2024 +0200 [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 --- .github/workflows/javaTests.yml | 2 +- .github/workflows/python.yml | 12 ++++++++++-- src/main/python/.gitignore | 5 +++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/javaTests.yml b/.github/workflows/javaTests.yml index 595298b8f4..f896d1fcaf 100644 --- a/.github/workflows/javaTests.yml +++ b/.github/workflows/javaTests.yml @@ -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 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 858e52e3c4..a53aa406bd 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -128,7 +128,7 @@ 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: " $? @@ -136,7 +136,7 @@ jobs: 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: " $? @@ -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/codecov-action@v4.2.0 + if: github.repository_owner == 'apache' + env: + fail_ci_if_error: false + files: src/main/python/.coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/main/python/.gitignore b/src/main/python/.gitignore index 6051f275aa..334a5b7896 100644 --- a/src/main/python/.gitignore +++ b/src/main/python/.gitignore @@ -52,3 +52,8 @@ systemds/SystemDS.jar # tutorial systemds/examples/tutorials/* + +# test coverage +.coverage +.coverage.xml +