Univention Bugzilla – Bug 37102
use python-coverage in ucs-test
Last modified: 2022-09-27 17:30:08 CEST
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.
This seems to have broken the last Jenkins run: +280 failures like <http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-2/job/AutotestJoin/lastCompletedBuild/SambaVersion=s4,Systemrolle=master/testReport/72_udm-extensions/41_test_udm_module/test/>
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.
(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.
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
For this bug is no separate QA needed.