Comment 1 for bug 987077

Revision history for this message
Renier Morales (renier-h) wrote :

Even though we are passing --cover-package to nose (in run_tests.sh), it collects data on everything (seems this option is only to filter report output, not data collection). Problem is that when we use the coverage script directly to generate the report, we don't pass any report filtering option to it, so it goes and tries to generate report on all the data collected.

It happens that feedparser, used by nova/tests/api/openstack/compute/test_versions.py uses drv_libxml2 (python xml parser-- if installed on the system) and this file has a bad utf-8 character in it. So when coverage is generating the html report for this file, it crashes trying to decode parts of the file into utf8.

This problem is actually fixed upstream in the coverage tool, but this has not been put in an official release yet (see https://bitbucket.org/ned/coveragepy/issue/157/chokes-on-source-files-with-non-utf-8).

Solution seems to be to add filtering to the direct coverage tool call in run_tests.sh. After I did this in my working dir, things ran fine generating the right nova coverage reports. Putting a patch together on this.