8000 Use Python version as flag for Codecov by hugovk · Pull Request #464 · python/bedevere · GitHub
[go: up one dir, main page]

Skip to content

Use Python version as flag for Codecov #464

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

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

hugovk
Copy link
Member
@hugovk hugovk commented May 31, 2022

Fixes #462.

Re: #462 (comment)

Two things here.

First add -cov-report=term to pytest, so we get output like this for 3.11 and can see coverage is missing (and 100% with 3.8-3.10):

Name                      Stmts   Miss Branch BrPart  Cover
-----------------------------------------------------------
bedevere/__init__.py          0      0      0      0   100%
bedevere/__main__.py         37      0      4      1    98%
bedevere/backport.py         63      0     36      0   100%
bedevere/close_pr.py         22      0     14      0   100%
bedevere/filepaths.py        15      0     12      0   100%
bedevere/gh_issue.py         72      0     34      1    99%
bedevere/news.py             51      0     28      0   100%
bedevere/prtype.py           33      0     19      0   100%
bedevere/stage.py           117      0     60      9    95%
bedevere/util.py             67      0     24      1    99%
tests/__init__.py             0      0      0      0   100%
tests/test___main__.py       25      0      0      0   100%
tests/test_backport.py      146      0     22      0   100%
tests/test_close_pr.py       95      0     16      0   100%
tests/test_filepaths.py     106      0      8      0   100%
tests/test_gh_issue.py      249      0     96      9    97%
tests/test_news.py          155      0     28      0   100%
tests/test_prtype.py        103      0      2      0   100%
tests/test_stage.py         291      0     10      0   100%
tests/test_util.py           73      0      6      0   100%
-----------------------------------------------------------
TOTAL                      1720      0    419     21    99%

https://github.com/hugovk/bedevere/runs/6665212616?check_suite_focus=true#step:6:27

Second, add a Python version as a flag to the Codecov upload in each matrix job.

This adds a dropdown to the file view:

image

And for example selecting Python_3.11 shows these uncovered lines:

image

https://app.codecov.io/gh/hugovk/bedevere/blob/300b7d0ed649e9535c59db9824e9d1b041080839/bedevere/stage.py

Note

The flag must have no spaces as it's used as a URL parameter during upload.

We could skip those include lines that define matrix.codecov_flag and instead use flags: Python_${{ matrix.python_version }}, except it wouldn't work for the "3.11.0-alpha - 3.11.0" version.

We could replace ""3.11.0-alpha - 3.11.0" with 3.11-dev instead, as far as I know that does the same thing, and is better: it has no upper limit of the .0 final version. For example 3.10-dev is pointing to 3.10.4. And anyway, when 3.11.0 comes out, we're going to replace it with "3.11".

@codecov
Copy link
codecov bot commented May 31, 2022

Codecov Report

Merging #464 (c2bdb93) into main (6e98e09) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #464   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         1721      1721           
  Branches       208       208           
=========================================
  Hits          1721      1721           
Flag Coverage Δ
Python_3.10 100.00% <ø> (?)
Python_3.11-dev 100.00% <ø> (?)
Python_3.8 100.00% <ø> (?)
Python_3.9 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@ezio-melotti
Copy link
Member

Thanks for working on this!

We could replace ""3.11.0-alpha - 3.11.0" with 3.11-dev instead, as far as I know that does the same thing, and is better: it has no upper limit of the .0 final version.

This sounds good to me -- do you want to include it in this PR? Would including this remove the need for custom flags variables?

@hugovk
Copy link
Member Author
hugovk commented May 31, 2022

Updated here! Yes, we can ditch those extra variables: c2bdb93 (#464)

@ezio-melotti
Copy link
Member

All the tests are now passing.

@ezio-melotti ezio-melotti merged commit 709c31c into python:main Jun 2, 2022
@hugovk hugovk deleted the codecov-flags branch June 2, 2022 16:34
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.

Run Codecov with the right version
2 participants
0