Bug 37102 - use python-coverage in ucs-test
use python-coverage in ucs-test
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: UDM
unspecified
Other Linux
: P5 normal with 2 votes (vote)
: ---
Assigned To: Florian Best
:
Depends on: 34812 34836
Blocks: 43812
  Show dependency treegraph
 
Reported: 2014-11-28 14:28 CET by Florian Best
Modified: 2022-09-27 17:30 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2014-11-28 14:28:50 CET
We should use python-coverage to check which lines are covered by our ucs-test.

At least the handlers:
users/user.py
groups/group.py
computers/computer.py

should be checked.
Comment 2 Florian Best univentionstaff 2016-07-26 13:54:59 CEST
ucs-test (6.0.35-9):
r71228 | Bug #37102: Add univention.testing.coverage

The argument --with-coverage has been added to ucs-test which enabled coverage testing.
The argument --branch-coverage specifies that also code-branches instead of lines only should be measured.
The argument --coverage-sources (can be given multiple times) specifies the modules which should be measured. E.g. --coverage-sources ucsschool.lib.

Still open because /usr/share/univention-directory-manager-tools/univention-cli-client does os.fork() which is incompatible with coverage-measuring. Need to find a workaround.
Comment 3 Florian Best univentionstaff 2016-07-26 17:42:50 CEST
(In reply to Florian Best from comment #2)
> Still open because
> /usr/share/univention-directory-manager-tools/univention-cli-client does
> os.fork() which is incompatible with coverage-measuring. Need to find a
> workaround.
We need to Fix Bug #34812 and Bug #34836 for this.
Comment 4 Florian Best univentionstaff 2016-09-14 16:46:52 CEST
In ucs-test everything which is required for this is commited.

To really use this for UDM we need to fix the mentioned bugs Bug #34812 and Bug #34836.
Also measuring code coverage doesn't work with the 'thread' module. python-notifier uses the thread module (instead of 'threading') so that we can't measure e.g. the threads used in UMC modules. This should be okay at the moment.
http://coverage.readthedocs.io/en/coverage-4.1/trouble.html

https://bitbucket.org/ned/coveragepy/issues/43/coverage-measurement-fails-on-code
https://bitbucket.org/ned/coveragepy/issues/310/coverage-fails-with-osfork-and-os_exit
Comment 5 Stefan Gohmann univentionstaff 2016-10-12 07:48:09 CEST
For this bug is no separate QA needed.