Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI, enhancement] add pytest-cov for testing #2104

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
DPCFLAG="0"
if [ $(echo ${{ matrix.PYTHON_VERSION }} | grep '${{ env.DPCTL_PY_VERSIONS }}') ]; then DPCFLAG=''; fi
echo "DPCFLAG=${DPCFLAG}" >> "$GITHUB_OUTPUT"
# enable coverage report generation
echo "COVERAGE=true" >> "$GITHUB_ENV"
- name: apt-get
run: sudo apt-get update && sudo apt-get install -y clang-format
- name: dpcpp installation
Expand Down
11 changes: 8 additions & 3 deletions conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ if [[ count -eq 0 ]]; then
exit 1
fi

COV_ARGS=(--no-cov)
if [[ "$COVERAGE" == "true" ]]; then
COV_ARGS=(--cov-config '$daal4py_dir/.coveragerc' --cov-report term)
fi

echo "Start testing ..."
return_code=0

Expand All @@ -50,15 +55,15 @@ python -m unittest discover -v -s ${daal4py_dir}/tests -p test*.py
return_code=$(($return_code + $?))

echo "Pytest of daal4py running ..."
pytest --verbose --pyargs ${daal4py_dir}/daal4py/sklearn
pytest --verbose ${daal4py_dir}/daal4py/sklearn "${COV_ARGS[@]}"
return_code=$(($return_code + $?))

echo "Pytest of sklearnex running ..."
pytest --verbose --pyargs sklearnex
pytest --verbose --pyargs sklearnex "${COV_ARGS[@]}"
return_code=$(($return_code + $?))

echo "Pytest of onedal running ..."
pytest --verbose --pyargs ${daal4py_dir}/onedal
pytest --verbose --pyargs onedal
return_code=$(($return_code + $?))

echo "Global patching test running ..."
Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ catboost==1.2.7 ; python_version < '3.11' # TODO: Remove 3.11 condition when cat
shap==0.46.0
array-api-compat==1.9
array-api-strict==2.0.1
pytest-cov==5.0.0