-
Notifications
You must be signed in to change notification settings - Fork 18
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
Codacy code coverage reporting #443
base: devel
Are you sure you want to change the base?
Conversation
Codacy integration seems working. Link to report: https://app.codacy.com/gh/pyccel/psydac/coverage?branch=codacy-codecov |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
Detailed coverage results are also shown in CI: https://github.com/pyccel/psydac/actions/runs/11180714225/job/31083050038?pr=443#step:22:20 |
The single-process tests on Ubuntu with Python 3.12 are taking almost one hour and a half to run. This does not happen with the other jobs. Do you see a reason for this? |
EDIT 12-Nov: Root cause of slowdown due to changes in Python 3.11. See python/cpython#93516 |
Overhead due to coverage data collection is the same for coverage.py and pytest-cov
pytest_cache should be saved whenever its contents changes. Cache saving only triggers if the associated cache key changes; thus the cache key should automatically update based on the contents of pytest_cache, which is uniquely represented by its hash.
All single process tests will still be run regardless of test order; thus we don't really reduce test time.
@campospinto's suggestion is neat! coverage now runs only on macOS and the Ubuntu test time is back to normal. This PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! I have some questions below.
By the way, I thought you wanted to use Pytest's cache to run the failed tests first. Have you abandoned the idea?
|
||
# Don't complain if non-runnable code isn't run: | ||
"if 0:", | ||
"if __name__ == .__main__.:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the use of the dots .
a bit confusing in this regex. You actually want to match just the single and double quote marks, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You actually want to match just the single and double quote marks, right?
Exactly; this snippet was based from here: https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
…oml, changed if 0 -: if False
Continuation of adding test coverage support which was initially started in #405.