Skip to content

Commit 5d8cf2d

Browse files
authored
Improve coverage report (#1609)
* Improve coverage report * Temporary skip tests failed due to dpctl * Tuned config to exclude dpctl files from the report * Filtered exporting coverage data by dpnp source * Removed w/a with temporary muted tests
1 parent 38b0c4f commit 5d8cf2d

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.github/workflows/generate_coverage.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,32 @@ jobs:
3939
- name: Install Lcov
4040
run: |
4141
sudo apt-get install lcov
42+
4243
- name: Install dpnp dependencies
4344
run: |
4445
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
4546
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
47+
4648
- name: Conda info
4749
run: |
4850
conda info
4951
conda list
52+
5053
- name: Build dpnp with coverage
5154
run: |
5255
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
56+
5357
- name: Install coverall dependencies
5458
run: |
5559
sudo gem install coveralls-lcov
5660
pip install coveralls==3.2.0
61+
5762
- name: Upload coverage data to coveralls.io
5863
run: |
5964
echo "Processing pytest-coverage"
6065
export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov)
6166
coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json
67+
6268
# merge file with coverage data and upload
6369
echo "Merging files with coverage data"
6470
coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json

dpnp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function(build_dpnp_cython_ext _trgt _src _dest)
88
add_dependencies(${_trgt} ${_trgt_deps})
99
if (DPNP_GENERATE_COVERAGE)
1010
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
11+
target_compile_options(${_trgt} PRIVATE "-fno-sycl-use-footer")
1112
endif()
1213
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
1314
# NumPy

scripts/gen_coverage.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ def find_objects():
8282
objects = []
8383
dpnp_path = os.getcwd()
8484
search_path = os.path.join(dpnp_path, "dpnp")
85-
files = os.listdir(search_path)
86-
for file in files:
87-
if file.endswith("_c.so"):
88-
objects.extend(["-object", os.path.join(search_path, file)])
85+
for root, _, files in os.walk(search_path):
86+
for file in files:
87+
if (
88+
file.endswith("_c.so")
89+
or root.find("extensions") != -1
90+
and file.find("_impl.cpython") != -1
91+
):
92+
objects.extend(["-object", os.path.join(root, file)])
8993
return objects
9094

9195
objects = find_objects()
@@ -112,7 +116,8 @@ def find_objects():
112116
"-ignore-filename-regex=/tmp/icpx*",
113117
"-instr-profile=" + instr_profile_fn,
114118
]
115-
+ objects,
119+
+ objects
120+
+ ["-sources", "dpnp"],
116121
stdout=fh,
117122
)
118123

0 commit comments

Comments
 (0)