-
Notifications
You must be signed in to change notification settings - Fork 264
Implement lcov coverage collection for libvirt #4326
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -904,13 +904,18 @@ sysprep_options = "--operations machine-id" | |
|
|
||
| # Enable Code Coverage report | ||
| # prerequisite: qemu build test is run with --enable-gcov | ||
| # or libvirt is built with --enable-coverage | ||
| # configure option and preserve_srcdir = yes | ||
| # and qemu build dir is available | ||
| # Enable/disable gcov for qemu, default: disable | ||
| gcov_qemu = no | ||
| # Enable/disable to reset the code coverage report | ||
| # generated/collected by previous test | ||
| gcov_qemu_reset = yes | ||
| # Coverage output format: lcov (generates .info tracefiles) or html (generates HTML reports) | ||
| # For per-test lcov tracefiles with --test-name, use "lcov" | ||
| # For aggregated HTML reports with gcovr, use "html" | ||
| gcov_qemu_format = html | ||
| # Additional command options for gcovr | ||
| # E:g:- "--html-details --html --exclude-directories=capstone" | ||
| # above options will be required to collect detailed html | ||
|
|
@@ -920,6 +925,32 @@ gcov_qemu_reset = yes | |
| gcov_qemu_collect_cmd_opts = "--html" | ||
| # Enable/disable to compress code coverage report | ||
| gcov_qemu_compress = no | ||
| # Qemu build directory where .gcda files are generated | ||
| gcov_qemu_builddir = /var/tmp/qemu | ||
| # Fail test if coverage reset fails | ||
| gcov_qemu_reset_strict = yes | ||
|
|
||
| # Libvirt code coverage configuration | ||
| # Enable/disable gcov for libvirt, default: disable | ||
| gcov_libvirt = no | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whether collect libvirt or qemu code coverage depends on parameters dynamically passed in by Kar, therefore needs to confirm with Kar members whether this parameter value can be override by parameters passed in by Kar
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kar and avocado can set different variants values in command line. Please check the test results in description. |
||
| # Enable/disable to reset the libvirt coverage report | ||
| # generated/collected by previous test | ||
| gcov_libvirt_reset = yes | ||
| # Coverage output format: lcov or html | ||
| gcov_libvirt_format = lcov | ||
| # Libvirt build directory where .gcda files are generated | ||
| gcov_libvirt_builddir = /var/tmp/libvirt | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we use libvirt virtcov packages, the value for this needs to be /builddir/build/BUILD
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we need to get the proper path after the package installation, so I just put a fake dir here. Users need to specify the correct one during their testings. |
||
| # Additional command options for gcovr when format is html | ||
| # E.g.: "--html-details --html --exclude-unreachable-branches" | ||
| gcov_libvirt_collect_cmd_opts = "--html" | ||
| # Enable/disable to compress libvirt code coverage report | ||
| gcov_libvirt_compress = no | ||
| # Libvirt daemon to restart after coverage reset (if needed) | ||
| gcov_libvirt_daemon = libvirtd | ||
| # Enable/disable restarting libvirt daemon after coverage reset | ||
| gcov_libvirt_restart_daemon = no | ||
| # Fail test if coverage reset fails | ||
| gcov_libvirt_reset_strict = yes | ||
|
|
||
| Linux: | ||
| # param for installing stress tool from repo | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For lcov , we needs to use https://github.com/LuyaoHuang/lcov --rhel version since it fix the issue that test case can not contain special letters. So here we needs to consider this point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right. I think it's better to put lcov installation part in ci, similar place with libvirt/qemu coverage package installation, so I just checked lcov command here.