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

Find a way to run coverage on python 3.11 #1377

Closed
opotowsky opened this issue Aug 7, 2023 · 2 comments · Fixed by #1382
Closed

Find a way to run coverage on python 3.11 #1377

opotowsky opened this issue Aug 7, 2023 · 2 comments · Fixed by #1382
Labels
ci Related to continuous integration / github actions good first issue Good for newcomers testing Related to tests

Comments

@opotowsky
Copy link
Member

Typically, github actions are set to run on the latest version of python that we have tested with ARMI. #1341 originally set out to bring all GH actions up to python 3.11, but a known issue with coverage (#1058) prevented us from updating the coverage dependency to a python 3.11 compatible version.

We need to investigate the bug with the coverage version and see if it can be fixed.

I had coverage pinned to 7.2.1 in both setup.py and the coverage workflow, and the action failed.

Update: I'm not sure what the above bug is all about, but coveragepy_lcov has not been updated in 1.5 years and is not python 3.11 compatible. So we will need to completely rework the cooverage step to make it run on python 3.11

@opotowsky opotowsky added the ci Related to continuous integration / github actions label Aug 7, 2023
@john-science john-science added help wanted good first issue Good for newcomers testing Related to tests labels Aug 7, 2023
@john-science
Copy link
Member

Well, that's a bit of a shame.

ARMI currently uses coveragepy_lcov and coveralls.io.

To be honest, I don't love coveralls.io. It's been fine lately, but last year it broke a bunch of times. My guess is if we moved away from that, we would end up using some other tool than coveragepy_lcov anyway.

#1017

@ntouran
Copy link
Member

ntouran commented Aug 9, 2023

Open issue with coverage_lcov being incompatible with coverage 7.0.0 is here

FWIW, running coverage run -m pytest -x -n 32 armi with python 3.11 works like a charm using coverage 7.2.7, which I guess you already knew.

Looks like pytest can output directly to lcov format though so we can skip the lcov conversion:

commands = pytest --cov --cov-report=lcov

ref: https://github.com/epitools/epitools/pull/72/files

I tried running a modified version of our tox test line:

coverage run --rcfile=.coveragerc -m pytest -n 16 --cov=armi --cov-config=.coveragerc --cov-append --ignore=venv --cov-report=lcov armi

and sure enough coverage.lcov showed up in the working dir! So just a minor change to tox and actions will fix this methinks.

ntouran added a commit that referenced this issue Aug 9, 2023
coveragepy-lcov is incompatible with coverage 7.0.0 and
in fact is totally unnecessary now that pytest can write
lcov format files directly. This switches pytest
to write lcov directly. Now coverage should work in CI
on python 3.11

Fixes #1377
ntouran added a commit that referenced this issue Aug 9, 2023
* Remove coveragepy-lcov dependency during CI.

coveragepy-lcov is incompatible with coverage 7.0.0 and
in fact is totally unnecessary now that pytest can write
lcov format files directly. This switches pytest
to write lcov directly. Now coverage should work in CI
on python 3.11

Fixes #1377

* Remove coverage pins and change coverage to py311.

Requested in review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to continuous integration / github actions good first issue Good for newcomers testing Related to tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants