Skip to content

Dev: coverage: inject coverage with sitecustomize.py in feature tests #1458

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

Conversation

nicholasyang2022
Copy link
Collaborator

@nicholasyang2022 nicholasyang2022 commented Jun 17, 2024

With python-coverage updated to 7.5.3 from 4.x, code called with multiprocessing is able to be measured now.

This is an refreshed version of #1297.

We used to inject the coverage in the program entrance /usr/sbin/crm.
However, crm.report uses multiprocessing and the child processes does
not execute code in /usr/sbin/crm. So its coverage cannot be caculated.

This patch use an alternative method, by using sitecustomize.py, to
inject the coverage. It should work for all python processes.
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.28%. Comparing base (8f4ac8f) to head (124750c).
Report is 6 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
integration 53.95% <ø> (+0.14%) ⬆️
unit 52.37% <ø> (+2.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nicholasyang2022 nicholasyang2022 marked this pull request as ready for review June 17, 2024 08:47
Copy link
Collaborator

@liangxin1300 liangxin1300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@liangxin1300 liangxin1300 merged commit 5ab3a5d into ClusterLabs:master Jun 17, 2024
31 checks passed
@nicholasyang2022 nicholasyang2022 deleted the feature-test-coverage-injected-by-sitecustomize-7.53 branch June 17, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants