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

Fixed Python coverage on GitHub Actions #4371

Merged
merged 6 commits into from
Jan 24, 2020

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Jan 19, 2020

In GitHub Actions, test.yml and test-windows.yml are not reporting Python coverage. This PR fixes that.

For test.yml, the clearest evidence that something is wrong is that macOS code is not covered.

While Travis has a line 'Generating coverage xml reports for Python', GHA has 'Python coveragepy not found'.

Looking at codecov, a way around the 'Python coveragepy not found' error is to provide a coverage.xml file.

So, in after_success.sh, we can replace coverage report with coverage xml to output the data to an XML file.

For test-windows.yml, it looks like essentially the 'After success' step was just omitted in #4084. Adding that, in combination with the first part of this PR, adds Python coverage.

@radarhere radarhere changed the title Fixed Python coverage on macOS and Ubuntu GHA Fixed Python coverage on test and test-windows GHA Jan 19, 2020
@hugovk
Copy link
Member

hugovk commented Jan 19, 2020

Whilst we're here, Codecov no longer support .codecov.yml, only codecov.yml:

They used to support both:

Shall we switch back in this PR or another?

@radarhere
Copy link
Member Author

Ok, I've added a commit to switch the filename.

@nulano
Copy link
Contributor

nulano commented Jan 19, 2020

Should the shell be specified for Windows? The default is powershell, I'm guessing PowerShell opened the .ci/after_success.sh script in bash based on the filename, but I'm not sure I would rely on this behavior to work indefinitely.


It looks like there is still no Python coverage from the Docker jobs on GHA, but there is C coverage (You have to unselect all, then select e.g. GHA>amazon-1-amd64; I couldn't find a direct link). Looking back, it was already missing when #4316 was merged. It looks like it is failing to find the Python source code.

@hugovk
Copy link
Member

hugovk commented Jan 19, 2020

Windows shell: sounds wise to specify the shell rather than relying on the default. GHA has been a bit of a moving target.


Docker: interesting, let's deal with that separately, please can you open a new issue?

Confirmed in this Docker-only build:

(At the "Docker build" step, it reports coverage on Python files like /vpy3/lib/python3.8/site-packages/Pillow-7.1.0.dev0-py3.8-linux-x86_64.egg/PIL/BdfFontFile.py, perhaps it's the path causing issues. Or perhaps generating xml would help there too.)

And that's a good tip about unselecting, thanks.

@hugovk
Copy link
Member

hugovk commented Jan 19, 2020

Codecov bot commenting means it didn't read comment: off in [.]codecov.yml. Maybe due to it being in transition in this PR. Let's hope it'll be fine when merged.

@radarhere
Copy link
Member Author

Ok, I've added a commit to specify the shell for Windows.

@radarhere radarhere changed the title Fixed Python coverage on test and test-windows GHA Fixed Python coverage on GHA Jan 24, 2020
@radarhere radarhere changed the title Fixed Python coverage on GHA Fixed Python coverage on GitHub Actions Jan 24, 2020
@radarhere
Copy link
Member Author

I've added a commit to fix Python coverage on Docker GHA. It can't find the Python files, so I'm moving them into place. However, it tries to look for PIL/_imaging.py, so I added --ignore-errors for the Docker jobs to work around it.

@hugovk hugovk merged commit d33d467 into python-pillow:master Jan 24, 2020
@hugovk
Copy link
Member

hugovk commented Jan 24, 2020

Thank you!

@radarhere radarhere deleted the coverage branch January 24, 2020 21:11
@python-pillow python-pillow deleted a comment from codecov bot Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants