You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@vlad-perevezentsev does Intel have an account with codecov.io? Is it not a paid service?
From a quick read of codecov.io page suggests that we will need to generate the coverage reports ourselves. We can surely use codecov.io services to generate reports. Also, it will be good to discuss with @xaleryb if code coverage generation using coverage.py or llvm-cov can be part of our internal CI. Maybe we can rely on a public CI instead?
In any case, we should definitely take help from the good folks at DPNP 👍
I played around with llvm-cov and was able to generate the summary and details reports using the tool. I will open a PR adding targets to our CMake scripts to automate the generation of the coverage reports.
@PokhodenkoSA question is where should these reports be stored?
E.g. for current master the C APi coverage is as follows:
@PokhodenkoSA question is where should these reports be stored?
I think output to terminal during CI is ok. We could consider to upload report to 3rd party service if llvm-cov could generate report in some common and appropriate format like xml.
@vlad-perevezentsev@PokhodenkoSA I added the bits for the C API coverage in PR #242. I will be nice if we can generate the html report for both Python and C and upload them to our gh-pages site.
gh-pages are for documentation. I do not think we need to push temporary information like coverage related to particular PR into the documentation.
The best way is to upload coverage info to 3rd party service like https://about.codecov.io/ (good example for integration). Also printing coverage to output is ok for beginning.
Part of the work done is contained in the PR #238
We implemented python,cython,and c++ file coverage using coverage and llvm-cov on Linux.
You need to install additional packages to cover conda install coverage conda install conda-forge::lcov conda install conda-forge::gtest
Before installing the package, you need to add an environment variable export CODE_COVERAGE=ON
It collects the debug version of dpctl and includes line tracing, which allows you to analyze the strings to create a coverage report.
The environment variable has been added for the convenience of configuring CI in the future.
Next, we install the package using the command python setup.py develop
The dpctl-c-api-coverage folder will appear in the root folder after installation
The folder contains a report on the coverage of c++ files in html format.
You need to run tests to cover the cython and python files coverage run -m unittest dpctl.tests
The required flags for the command coverage run are contained in the file .coveragerc
To show a report on the coverage results. coverage report -m
To create an annotated HTML listings with coverage results. coverage html
The htmlcov folder will appear in the root folder of the project. It contains reports on the coverage of python and cython files in html format.
Activity
diptorupd commentedon Dec 21, 2020
I spent some time exploring how this is done. For the C-API, we can use
llvm-cov(https://clang.llvm.org/docs/SourceBasedCodeCoverage.html) and for the Python APIcoverageshould work (https://developer.ibm.com/recipes/tutorials/testing-and-code-coverage-with-python/)vlad-perevezentsev commentedon Dec 22, 2020
@diptorupd, @PokhodenkoSA The dpNP team uses codecov.io and they are ready to help us. What do you say ?
diptorupd commentedon Dec 22, 2020
@vlad-perevezentsev does Intel have an account with codecov.io? Is it not a paid service?
From a quick read of codecov.io page suggests that we will need to generate the coverage reports ourselves. We can surely use codecov.io services to generate reports. Also, it will be good to discuss with @xaleryb if code coverage generation using
coverage.pyorllvm-covcan be part of our internal CI. Maybe we can rely on a public CI instead?In any case, we should definitely take help from the good folks at DPNP 👍
diptorupd commentedon Jan 18, 2021
I played around with
llvm-covand was able to generate the summary and details reports using the tool. I will open a PR adding targets to our CMake scripts to automate the generation of the coverage reports.@PokhodenkoSA question is where should these reports be stored?
E.g. for current master the C APi coverage is as follows:
PokhodenkoSA commentedon Jan 18, 2021
I think output to terminal during CI is ok. We could consider to upload report to 3rd party service if llvm-cov could generate report in some common and appropriate format like xml.
diptorupd commentedon Jan 19, 2021
@vlad-perevezentsev @PokhodenkoSA I added the bits for the C API coverage in PR #242. I will be nice if we can generate the html report for both Python and C and upload them to our gh-pages site.
PokhodenkoSA commentedon Jan 19, 2021
gh-pages are for documentation. I do not think we need to push temporary information like coverage related to particular PR into the documentation.
The best way is to upload coverage info to 3rd party service like https://about.codecov.io/ (good example for integration). Also printing coverage to output is ok for beginning.
vlad-perevezentsev commentedon Jan 25, 2021
Part of the work done is contained in the PR #238
We implemented python,cython,and c++ file coverage using coverage and llvm-cov on Linux.
You need to install additional packages to cover
conda install coverage
conda install conda-forge::lcov
conda install conda-forge::gtest
Before installing the package, you need to add an environment variable
export CODE_COVERAGE=ON
It collects the debug version of dpctl and includes line tracing, which allows you to analyze the strings to create a coverage report.
The environment variable has been added for the convenience of configuring CI in the future.
Next, we install the package using the command
python setup.py develop
The dpctl-c-api-coverage folder will appear in the root folder after installation
The folder contains a report on the coverage of c++ files in html format.
You need to run tests to cover the cython and python files
coverage run -m unittest dpctl.tests
The required flags for the command coverage run are contained in the file .coveragerc
To show a report on the coverage results.
coverage report -m
To create an annotated HTML listings with coverage results.
coverage html
The htmlcov folder will appear in the root folder of the project. It contains reports on the coverage of python and cython files in html format.
Useful links:
https://coverage.readthedocs.io/en/coverage-5.0/cmd.html
http://blog.behnel.de/posts/coverage-analysis-for-cython-modules.html
https://alastairs-place.net/blog/2016/05/20/code-coverage-from-the-command-line-with-clang/
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
https://github.com/mapbox/cpp/blob/master/docs/coverage.md