matplotlib / matplotlib/pytest-mpl

Provide an option to return base64-encoded images in CI log

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.