zopefoundation / RestrictedPython

A restricted execution environment for Python to run untrusted code.
http://restrictedpython.readthedocs.io/
Other
456 stars 38 forks source link

fix: combined coverage report #238

Open rudaporto opened 1 year ago

rudaporto commented 1 year ago

Currently, we have some issues regarding the combined coverage:

This PR is a POC to try to find a better way to implement both, the local coverage check and the CI one.

I',m aware that these files are autogenerated by the meta package. If we agree that this makes sense I would like to propose the creation of new templates in the meta package to handle this use case.

Here follow all the changes I implemented:

Tox:

CI:

Next step:

rudaporto commented 1 year ago

When using the matrix execution we can not collect the combined coverage from each python version.

davisagli commented 1 year ago

https://hynek.me/articles/ditch-codecov-python/ has a suggestion of how to do this

dataflake commented 1 year ago

FYI, the file .github/workflows/tests.yml is auto-generated and should not be edited by hand. It uses the meta/config package, see https://github.com/zopefoundation/meta/tree/master/config, which is configured using the .meta.toml file.

rudaporto commented 1 year ago

FYI, the file .github/workflows/tests.yml is auto-generated and should not be edited by hand. It uses the meta/config package, see https://github.com/zopefoundation/meta/tree/master/config, which is configured using the .meta.toml file.

Thank you @dataflake for the reminder. Yes, I know that this should not be changed directly. I've updated the description with a full explanation of what I tried to achieve.

I will convert this PR to a draft to avoid confusion.

icemac commented 1 year ago

I think this approach presented here is promising. It requires some changes in meta/config so it can produce the required tests.yaml. Currently we are running coverage just for one Python version. In most projects this is enough because (after dropping Python 2 support) there is nearly no Python version specific code. So for the other projects I think it will be enough just to run coverage on a single Python version, but here we have different goals.

I currently do not have the time and energy to push meta/config forward to be able to support the kind of changes required here, sorry.