Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Downloadable hash library in HTML summary #138

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 9 commits into from
Feb 21, 2022

Conversation

ConorMacBride
Copy link
Member

@ConorMacBride ConorMacBride commented Feb 17, 2022

Main task was creating the hash library file in the results directory and making it available to download in the sort/filter menu in the HTML summary. Fixed various other things:

HTML summary when generating

When generating baseline images, the generated images now appear in a requested HTML summary. (See the "Generating baseline images..." demos: https://macbride.me/pytest-mpl/.)

Documented behaviour when generating hashes

Documented the existing behaviour: when generating a hash library, the tests will also be run as usual against the existing hash library specified by --mpl-hash-library or the keyword argument. However, generating baseline images will always result in the tests being skipped.

Make an updated hash library downloadable from HTML summary

When the --mpl-results-always option is active, and some hash comparison tests are performed, a hash library containing all the result hashes will also be saved to the root of the results directory. The filename will be extracted from --mpl-generate-hash-library, --mpl-hash-library or hash_library= in that order.

Made the generated hash library available to download in the sort/filter menu of the HTML summary. (See any demo involving hash generation or comparison: https://macbride.me/pytest-mpl/.)

Closes #135

Removed incorrect warning

Removed warning Ignoring --mpl-result-path since --mpl-generate-path is set because when generating, a HTML summary may be saved there.

Added tests for the generating options

These test that the JSON summaries match for various combinations of hashes and/or images generating options. Generated hash libraries are verified against the baseline. (Although, generated images are not currently verified.) Any generated HTML summaries are available here: https://macbride.me/pytest-mpl/

Additional commits on 2022-02-19

  • Added image_status and hash_status to the JSON report so it's easier to determine the individual results in the HTML report. Statuses are match, diff, missing, generated and None.
  • Improved how the HTML template only shows relevant information based on the result of each test.
  • Updated the demos linked above to include the new commits.

@Cadair
Copy link
Contributor

Cadair commented Feb 21, 2022

There are a lot of changes here, they look good though.

Made the generated hash library available to download in the sort/filter menu of the HTML summary.

Can I suggest we put this next to the filter button (as an icon maybe?) I think it would be easier for sunpy contributors to find it if it wasn't behind another click?

@ConorMacBride
Copy link
Member Author

Sorry about all the changes. There was lots of changes which depended on other changes and I thought it would be quicker to merge them all together.

I'll move the download to a "#" button to the left of the filter button on the top menu.

@Cadair
Copy link
Contributor

Cadair commented Feb 21, 2022

Yeah, it's no worries, I just didn't do a line-by-line review ;)

@ConorMacBride
Copy link
Member Author

@Cadair Cadair merged commit 54510c5 into matplotlib:master Feb 21, 2022
@ConorMacBride ConorMacBride deleted the html-hashes-download branch February 28, 2023 19:18
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.

Generate an updated hash library for HTML summary
2 participants