[Epic] Add snapshot tests (migrate to insta
for tests)
#15178
Labels
enhancement
New feature or request
insta
for tests)
#15178
Is your feature request related to a problem or challenge?
Follow up on #15165, related to #10373
We currently have a lot of inline assertions when something is tested against a large pre-defined string(s). For example:
https://github.com/apache/datafusion/blob/main/datafusion/core/tests/dataframe/mod.rs#L2472-L2496
The issue with this approach is that every time we update logic, each of those tests needs to be updated manually. To make updates faster and easier, we're switching to insta. This issue will be a collection of small good-first-issue tickets to complete the transition.
Tickets to pick up
DataFrame
tests #15165In addition to the previous list, you can manually find places to rewrite logic. Generally, everything that uses
assert_batches_sorted_eq
,assert_batches_eq
,assert_contains
, or just compares with a very big string is a good candidate.Describe the solution you'd like
We should switch those assertions to
insta
You can see one example of this transition in #15165I made that change manually using IDE replace tools and a bit of regex. Initially, I just put
@"placeholder"
as a RHS and then rancargo insta test
to fill gaps and then confirmed it's the same as before via git diff. It didn't take a lot of time, but I think there are ways to make it faster:The text was updated successfully, but these errors were encountered: