Skip to content
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

Open
wants to merge 38 commits into
base: devel
Choose a base branch
from
Open

Codacy code coverage reporting #443

wants to merge 38 commits into from

Conversation

kvrigor
Copy link
Member

@kvrigor kvrigor commented Oct 2, 2024

Continuation of adding test coverage support which was initially started in #405.

@kvrigor
Copy link
Member Author

kvrigor commented Oct 3, 2024

Codacy integration seems working. Link to report: https://app.codacy.com/gh/pyccel/psydac/coverage?branch=codacy-codecov

Copy link

codacy-production bot commented Oct 4, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 5ff38841
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5ff3884) Report Missing Report Missing Report Missing
Head commit (a443720) 61320 36792 60.00%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#443) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@kvrigor kvrigor changed the title Codacy codecov Codacy code coverage reporting Oct 4, 2024
@kvrigor
Copy link
Member Author

kvrigor commented Oct 4, 2024

@kvrigor kvrigor marked this pull request as ready for review October 4, 2024 14:19
@kvrigor kvrigor requested a review from yguclu October 4, 2024 14:19
@yguclu
Copy link
Member

yguclu commented Oct 7, 2024

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?

@kvrigor kvrigor marked this pull request as draft October 14, 2024 14:32
@kvrigor
Copy link
Member Author

kvrigor commented Oct 14, 2024

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?

This could be an issue in coverage. See nedbat/coveragepy#1862

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.
@kvrigor kvrigor marked this pull request as ready for review October 24, 2024 16:29
@kvrigor
Copy link
Member Author

kvrigor commented Oct 24, 2024

@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.

Copy link
Member

@yguclu yguclu left a 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?

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
Copy link
Member

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?

Copy link
Member Author

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

@kvrigor kvrigor requested a review from yguclu November 6, 2024 11:02
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