matplotlib / matplotlib/pytest-mpl
Provide an option to return base64-encoded images in CI log
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 272
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Some CI services don't have good support for artifacts. In those cases we could print out to the log the base64 expected and actual image, inside a script to generate these files. Then one can simply copy/paste the script, run it locally, and get the images. See https://github.com/WorldWideTelescope/pywwt/blob/master/pywwt/tests/test_qt_widget.py#L67 for an example of this.
This could be triggered e.g. by an environment variable or a command-line flag (--mpl-base64).
Opened this following mention of this problem in https://github.com/matplotlib/pytest-mpl/issues/81
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the referenced example in pywwt/tests/test_qt_widget.py around line 67, then inspect pytest-mpl's existing command-line and image-comparison entry points. Implement an opt-in environment variable or --mpl-base64 mode that emits scripts containing expected and actual images for CI logs, and verify that the generated scripts recreate both images locally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100