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
Report coverage from integration test jobs #3643
base: main
Are you sure you want to change the base?
Conversation
@@ -130,7 +130,8 @@ jobs: | |||
sudo apt-get update | |||
sudo apt-get install build-essential gfortran libopenblas-dev | |||
- name: Setup Python | |||
uses: actions/setup-python@v2 | |||
id: python-install | |||
uses: actions/setup-python@v4 |
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.
Updating this version is a hard prerequisite because the python-version
output is only provided since v4.
e27df2c
to
b24a1f1
Compare
I've triggered the manual run in my fork since it doesn't run on PRs here. And here's the result confirming that this works: https://app.codecov.io/github/webknjaz/setuptools/commit/b24a1f1a61c1cad476558f847ee7cc3066b37aa2. |
The coverage reports in setuptools and in the need of some love, thank you very much for working on this @webknjaz! I am having some trouble to interpret the reports, it seems that adding the Do you think this is caused by the fact that the integration tests basically consists of nested subprocesses invoking setuptools? (i.e. calling Or is it because we are only traversing code paths that are already exercised with the normal test? (and therefore no increment is expected) Footnotes
|
@abravalheri no idea. Line 8 in 48adabe
pytest-cov somehow ignores that config? Maybe there's some env var influencing this? Dunno. Or maybe the unit tests just don't run any code that calls that module and the integration tests do?
I see it is also ignored during the test collection stage in pytest: Line 35 in f54ec14
So this means that pytest doesn't import it by itself (creating some coverage with such an import). I wonder if coveragepy's dynamic context could shed some light on the call stack. Perhaps, show which test invokes it. I don't think this information is recognized/rendered by Codecov, though. |
Probably 😅. I was looking at https://app.codecov.io/gh/pypa/setuptools/pull/3643.
I have the impression that the increment in coverage that I was expecting is not happening because we run Usually in my personal projects I have a configuration to ensure all the corresponding paths are unified by [paths]
source =
src/
*/site-packages/ However, since |
@abravalheri my impression was that those files weren't used in run-time either, no? |
b24a1f1
to
5210dcb
Compare
paths: | ||
- .* | ||
carryforward: false | ||
integration-test: # Integration tests |
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.
@abravalheri hopefully, this will allow Codecov not to report coverage drop on PRs not running integration tests.
Leaving the
What I would like to investigate is how to make coverage correctly report the hits in the setuptools/pkg_resource code. This is probably related to a coverage.py configuration like the one I mentioned in #3643 (comment) and/or https://coverage.readthedocs.io/en/6.2/subprocess.html. |
In https://github.com/abravalheri/setuptools/tree/abravalheri/maintenance/gha-integration-codecov I did a series of investigations to see if we could have the tests to report actual hits in the setuptools codebase. Unfortunately, I was not very successful. The idea behind integration tests is the following:
In theory Also in theory, I understand that it is a good practice to report the coverage over test files, but at the same time it would be good if the integration tests would report the hits in the setuptools implementation files. If anyone is interested in taking the investigation further, that would be very nice. |
a85759c
to
93ce5a0
Compare
Summary of changes
$sbj.
Pull Request Checklist
changelog.d/
.(See documentation for details)