<div dir="ltr"><span style="color:rgb(53,53,53);font-family:monospace;white-space:pre">The otopi 1.6.0 package currently in ovirt-master-snapshot includes</span><div><span style="color:rgb(53,53,53);font-family:monospace;white-space:pre">a new feature that allows you to collect coverage reports from your executions.
In order to enable the feature you'll need to provide
a configuration file like:
8<--------------------------------------
[run]
branch = True
[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
ignore_errors = True
8<------------------------------------
Be sure to have python-coverage and libselinux-python installed on your system and then execute:
OTOPI_COVERAGE=1 COVERAGE_PROCESS_START=<your config> <your command></span></div><div><span style="color:rgb(53,53,53);font-family:monospace;white-space:pre"> where your config is the path to your config file and your command may be engine-setup, engine-cleanup, ovirt-host-deploy, hosted-engine --deploy or any other possible command which uses otopi framework.</span></div><div><span style="color:rgb(53,53,53);font-family:monospace;white-space:pre">
In order to generate the report:
coverage html -d coverage_html_report</span></div><div><font color="#353535" face="monospace"><span style="white-space:pre"><br></span></font></div><div><font color="#353535" face="monospace"><span style="white-space:pre">This feature is already leveraged in otopi check-patches and check-merged jobs: <a href="http://jenkins.ovirt.org/search/?q=otopi_master_check">http://jenkins.ovirt.org/search/?q=otopi_master_check</a> </span></font></div><div>More test jobs will possibly follow.</div><div><br></div><div>New tests to improve coverage, improvements to the coverage configuration, suggestions, porting to other projects are welcome.</div><div><br></div><div><br></div><div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Sandro Bonazzola<br>Better technology. Faster innovation. Powered by community collaboration.<br>See how it works at <a href="http://redhat.com" target="_blank">redhat.com</a><br></div></div></div></div>
</div></div>