-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add option to disable snapshot diffing #581
Comments
Interesting. At first I thought this was a duplicate of #577, but your case has short line length, just a larger number of lines. An option to disable the diff makes sense to me though I also wonder if we can achieve a diff in a reasonable amount of time. Or have some heuristic to fallback to a different diff format/system for large snapshots. |
I think that would be an incredible feat! I let another workflow run its course and it took 1 hour and 30 minutes to produce 4 snapshot diffs: https://github.com/RobertCraigie/prisma-client-py/runs/4886243053?check_suite_focus=true |
Have a similar problem, I have pytest-timeout and the tests are timing out while preparing the diff. This may be similar to #625 in a way, but at the moment, I'm also looking for just a way to disable diff if the snapshot doesn't match. |
Temporary resolved it using a custom snapshot extension, class NoDiffSnapshotExtension(SingleFileSnapshotExtension):
def diff_snapshots(self, serialized_data, snapshot_data):
return "diff-is-disabled"
def diff_lines(self, serialized_data, snapshot_data):
return ["diff", "is", "disabled"] |
Thank you so much @BasitAli! That is a very nice solution :) |
Is your feature request related to a problem? Please describe.
I have multiple massive (~10k lines) snapshots and if any of them fail it takes a considerable amount of time to produce the diff. I also don't need to know what the difference is in this case.
An example snapshot can be found here: https://github.com/RobertCraigie/prisma-client-py/blob/main/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async%5Bactions.py%5D.raw
Describe the solution you'd like
Add a new config / cli option to disable diff creation and instead just show an error that the snapshots differ.
Describe alternatives you've considered
None that I can think of.
Additional context
This was discovered from this CI run: https://github.com/RobertCraigie/prisma-client-py/runs/4859619412?check_suite_focus=true which I cancelled after 14 minutes (it usually takes at most 3 minutes to complete).
The text was updated successfully, but these errors were encountered: