-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Update snapshots without re-running tests #9591
Comments
Thanks for opening the issue. While it clearly takes time, I disagree that it is unnecessary or unsafe. In fact, code alteration in the meantime is exactly why your proposal could be considered unsafe - it updates based on an old state, not the state when pressing |
@jeysal It should use the state that is shown in the terminal before pressing |
I understand your request, that is what you said in the OP, but it is a feature request and not a bug and it has to be considered as such, not as something we should change without a doubt. |
@jeysal For me the current behavior is unsafe. I am using jest to test a service that generates videos from requests. I generate a hash from video frames using ffmpeg after each request (https://ffmpeg.org/ffmpeg-formats.html#hash-1) for each video and store the hash in the snapshot. Generating videos takes a long time (even at low resolution and fps). There are many test cases. The hash does not actually tell me anything about the contents of the video so I need to review the video contents manually by opening the file in the output folder before submitting the new hash to the snapshot using interactive mode. In case the request queue was not cleaned correctly in the MQ server OR in case there is an orphaned process running an older version of the code in parallel I can actually add the hash of an entirely different video to the snapshot. Of course I could review the video twice but this is would be unnecessary if jest allows saving the snapshot displayed in the terminal without re-running the test. This can be a configuration option. |
I wonder if it makes sense to always always update with data from the previous run (like requested here), but still run the tests - that way we know that the data is stable. Right now you can snapshot |
@SimenB I think that it's a good idea especially if there is a way of opting out of the verification run. |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
Why should an issue be closed just because does not get comments? I never understood this on GitHub. How is that going to solve the issue or prove that the issue should be closed? |
See #12496 |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Currently you cannot update snapshots without re-running tests. This is problematic because:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Update the failed snapshot on disk without re-running the test.
The text was updated successfully, but these errors were encountered: