Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/javaTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ jobs:
with:
fail_ci_if_error: false
files: target/site/jacoco/jacoco.xml
flags: java
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload Jacoco Report Artifact PR
Expand Down
92 changes: 89 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
requests \
pandas \
unittest-parallel \
coverage

- name: Build Python Package
run: |
Expand All @@ -126,14 +127,16 @@ 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
mv .coverage .coverage.${{ matrix.test_mode }}

- name: Run tests no env
if: ${{ matrix.test_mode == 'noenv' }}
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
mv .coverage .coverage.${{ matrix.test_mode }}

- name: Run Federated Python Tests
if: ${{ matrix.test_mode == 'federated' }}
Expand All @@ -142,6 +145,7 @@ jobs:
export PATH=$SYSTEMDS_ROOT/bin:$PATH
cd src/main/python
./tests/federated/runFedTest.sh
mv .coverage .coverage.${{ matrix.test_mode }}

- name: Cache Torch Hub
if: ${{ matrix.test_mode == 'scuro' }}
Expand Down Expand Up @@ -175,4 +179,86 @@ jobs:
fvcore
kill $KA
cd src/main/python
python -m unittest discover -s tests/scuro -p 'test_*.py' -v
coverage run -m unittest discover -s tests/scuro -p 'test_*.py' -v
mv .coverage .coverage.${{ matrix.test_mode }}

- name: Save Python Test Coverage as Artifact
uses: actions/upload-artifact@v5
with:
name: .coverage.${{ matrix.test_mode }}
include-hidden-files: true
path: ${{ github.workspace }}/src/main/python/.coverage.${{ matrix.test_mode }}
retention-days: 1

determine_test_coverage:
name: Determine Test Coverage
runs-on: ${{ matrix.os }}
needs: [
test
]
strategy:
fail-fast: false
matrix:
python-version: [3.8]
os: [ubuntu-24.04]

steps:
- name: Checkout Repository
uses: actions/checkout@v5

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Install coverage package
run: |
pip install --upgrade pip
pip install coverage

- name: Download all Python Coverage Artifacts
uses: actions/download-artifact@v6
with:
pattern: .coverage.*
path: ${{ github.workspace }}/src/main/python/

- name: Merge Python Coverage Reports
run: |
cd src/main/python
coverage combine .coverage.*
coverage xml -o coverage.xml

- name: Upload merged coverage report to Codecov
uses: codecov/[email protected]
if: github.repository_owner == 'apache'
with:
fail_ci_if_error: false
files: src/main/python/coverage.xml
flags: python
name: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload Coverage Report Artifact PR
if: (github.repository_owner == 'apache') && (github.ref_name != 'main')
uses: actions/upload-artifact@v5
with:
name: coverage.xml
path: src/main/python/coverage.xml
retention-days: 7

- name: Upload Coverage Report Artifact Main
if: (github.repository_owner == 'apache') && (github.ref_name == 'main')
uses: actions/upload-artifact@v5
with:
name: coverage.xml
path: src/main/python/coverage.xml
retention-days: 30

- name: Upload Coverage Report Artifact Fork
if: (github.repository_owner != 'apache')
uses: actions/upload-artifact@v5
with:
name: coverage.xml
path: src/main/python/coverage.xml
retention-days: 3
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ To build from source visit [SystemDS Install from source](https://apache.github.
[![Documentation](https://github.com/apache/systemds/actions/workflows/documentation.yml/badge.svg?branch=main)](https://github.com/apache/systemds/actions/workflows/documentation.yml)
[![LicenseCheck](https://github.com/apache/systemds/actions/workflows/license.yml/badge.svg?branch=main)](https://github.com/apache/systemds/actions/workflows/license.yml)
[![Java Tests](https://github.com/apache/systemds/actions/workflows/javaTests.yml/badge.svg?branch=main)](https://github.com/apache/systemds/actions/workflows/javaTests.yml)
[![codecov](https://codecov.io/gh/apache/systemds/graph/badge.svg?token=4YfvX8s6Dz)](https://codecov.io/gh/apache/systemds)
[![Java Coverage](https://codecov.io/gh/apache/systemds/graph/badge.svg?token=4YfvX8s6Dz&flag=java)](https://codecov.io/gh/apache/systemds)
[![Python Test](https://github.com/apache/systemds/actions/workflows/python.yml/badge.svg?branch=main)](https://github.com/apache/systemds/actions/workflows/python.yml)
[![Python Coverage](https://codecov.io/gh/apache/systemds/graph/badge.svg?token=4YfvX8s6Dz&flag=python)](https://codecov.io/gh/apache/systemds)
[![Total PyPI downloads](https://static.pepy.tech/personalized-badge/systemds?units=abbreviation&period=total&left_color=grey&right_color=blue&left_text=Total%20PyPI%20Downloads)](https://pepy.tech/project/systemds)
[![Monthly PyPI downloads](https://static.pepy.tech/personalized-badge/systemds?units=abbreviation&left_color=grey&right_color=blue&left_text=Monthly%20PyPI%20Downloads)](https://pepy.tech/project/systemds)
29 changes: 29 additions & 0 deletions src/main/python/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------

[run]
omit =
; omit files generated by opencv-python, see https://github.com/coveragepy/coveragepy/issues/1653
config.py
config-3.py
; omit pytorch-generated files
/tmp/*
**/.torch/*
2 changes: 1 addition & 1 deletion src/main/python/tests/federated/runFedTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Fed3=$!
echo "Starting workers" && sleep 6 && echo "Starting tests"

# Run test
python -m unittest discover -s tests/federated -p 'test_*.py' $1 >$log 2>&1
coverage run -m unittest discover -s tests/federated -p 'test_*.py' $1 >$log 2>&1
pkill -P $Fed1
pkill -P $Fed2
pkill -P $Fed3
Expand Down
Loading