Skip to content

Conversation

@cvanelteren
Copy link
Collaborator

@cvanelteren cvanelteren commented Mar 2, 2025

Pytest does not allow to only store failed tests. This PR addresses this issue by providing a plugin that removes all successful tests from the results dir. It needs to be called as

pytest --mpl --mpl-baseline-path=baseline --mpl-default-style="./ultraplot.yml" --store-failed-only --mpl-results-path=./results ultraplot/tests/test_1dplots.py::test_heatmap_labels --mpl-generate-summary=html

This builds upon the issues raised in #103 #89

@cvanelteren cvanelteren changed the title init upload failed plugin override Only store failed tests mpl-pytest Mar 2, 2025
@cvanelteren
Copy link
Collaborator Author

Note this reasons from the perspective that all tests are run. It should be better to inverse the pattern (only store failed) but this way is easier and does not require an additional directory.

@cvanelteren
Copy link
Collaborator Author

The idea would be to host the full baseline on a separate repo and push the failed to readthedocs as suggested by @beckermr

Copy link
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test this live by adding the flag, making a test fail, and ensuring the output looks correct.

@cvanelteren
Copy link
Collaborator Author

Did this locally, but I will push an error now.

@beckermr
Copy link
Collaborator

beckermr commented Mar 2, 2025

We need to add the flag to the pytest call too in order to test.

Copy link
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The artifacts are still ~90 MB and I see all of the plots in them. Something is not working here...

@cvanelteren
Copy link
Collaborator Author

Will check later.

@cvanelteren
Copy link
Collaborator Author

Should be good now @beckermr

@cvanelteren
Copy link
Collaborator Author

Locally it would look like:
image
with the failed test only showing.

@beckermr
Copy link
Collaborator

beckermr commented Mar 2, 2025

I am trying a failure live again.

@beckermr beckermr enabled auto-merge (squash) March 2, 2025 18:23
@beckermr beckermr merged commit 342720e into Ultraplot:main Mar 2, 2025
13 checks passed
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.

2 participants