Suggestions for -update behavior
What will I do with all the free time I get from using autogold? :-)
I noticed two things that could probably improve -update behavior, based on my experience with similar workflows (Jest updateSnapshot and OCaml expect tests):
-
Silently succeed when update succeeds (exit 0, no messages). This would be consistent behavior with what I've seen elsewhere. I noticed that the current behavior prints "Fail", shows the diff, and exits 1 the first time
-updateis passed. This makes me wonder if the tests updated, since it matches the output of not running the test with-update. It would also be useful for autogold then to reserve printing something for an-updatecommand only in case of an autogold warning or error, e.g., if it couldn't update a test for some reason. -
I noticed
-updatewill only update one test value at a time, so I have to do likefor i inseq 1 20; do go test -update; doneuntil I notice it's done. Would be great if it updated all the test values at once.
Thanks for filing!
- Definitely agree we should match Jest and OCaml behavior here (make
-updatenot fail). - Will be fixed by making
-updatenot fail.
Since this is a breaking change, and there are a few other breaking changes I'd like to make soon-ish, I'll tag this as v2. https://github.com/hexops/autogold/issues?q=is%3Aissue+is%3Aopen+label%3Av2