Skip to content

Verify result figures using approval testing #890

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 22 commits into from
Apr 30, 2025

Conversation

matthiasschaub
Copy link
Member

@matthiasschaub matthiasschaub commented Mar 5, 2025

Description

Corresponding issue

Closes #889

New or changed dependencies

  • Kaleido

Todos

  • [ ] Support Windows by adding PyCharm and Visual Studio Code reporter (Winows paths) -> Fallback to PythonNativeReporter (print to console)
  • Check if ImageDiffReporter is running in MacOS by running below commands ( @mmerdes ):
rm tests/approvals/integrationtests/indicators/test_currentness.py-TestFigure-test_create_figure.approved.png
pytest

Checklist

  • I have ensured my branch is mergeable with main (e.g. through git rebase main if necessary)
  • My code follows the style guide and was checked with pre-commit before committing
  • I have commented my code
  • I have added sufficient unit and integration tests
  • I have added new Hurl regression tests and checked all existing tests
  • I have updated the CHANGELOG.md

Move Namer to own module.

Approval files are now stored in `/tests/approvals` instead of
`/tests/integrationtests/approved`.
Previously tests checked only if result description is not None or
contained a sub-string. Now the whole result description is verified
using approval testing.
@matthiasschaub matthiasschaub changed the title Approval tests for figures Verify result figures using approval testing Mar 5, 2025
to be able to output plotly figures as png which is needed to use
approval testsing on figures.
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch from 09f7d54 to 6671a35 Compare March 6, 2025 00:00
@matthiasschaub matthiasschaub marked this pull request as ready for review March 6, 2025 00:00
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch 2 times, most recently from af04271 to 4154b9d Compare March 25, 2025 15:18
add custom PlotlyReporter for approvaltests to verify the image
representation of Plotly figures using diff tools which can display
images (E.g. pycharm and vscode)
Use ImageReporter to verify result figures by displaying an received and
approved images of the figure in a diff tool
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch from 4154b9d to 94bb7ca Compare March 26, 2025 13:08
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch 5 times, most recently from 162ae09 to 0adeed7 Compare March 27, 2025 11:54
Currentness indicator does format time to string representation which
where different depending on the locale setting of the machine. This
commit will set the locale to always be en_US.
for mapping saturation indicator
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch from 0adeed7 to a075b2e Compare March 27, 2025 14:15
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch from 6b94fe7 to d50d968 Compare March 28, 2025 14:55
if PlotlyFigureReport fails
@matthiasschaub matthiasschaub force-pushed the approval-tests-for-figures branch from f1c310b to 5281bc1 Compare March 28, 2025 15:30
@matthiasschaub matthiasschaub merged commit b0e1bb2 into main Apr 30, 2025
2 checks passed
@matthiasschaub matthiasschaub deleted the approval-tests-for-figures branch April 30, 2025 07:33
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.

Use approval testing for figures
1 participant