diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd5a059c5e..8ec6f5eef3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/conda-recipe/run_test.sh b/conda-recipe/run_test.sh index 172a6c3721..cc7466b061 100755 --- a/conda-recipe/run_test.sh +++ b/conda-recipe/run_test.sh @@ -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 @@ -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 ..." diff --git a/requirements-test.txt b/requirements-test.txt index d5af4e380b..563198897c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -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