-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Migrate tests to insta #15288
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
Migrate tests to insta #15288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looks nice! Left two small nits
"+-------+", | ||
]; | ||
assert_batches_eq!(expected, &result); | ||
results.extend([result]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
results.extend([result]); | |
results.push(result); |
]; | ||
|
||
assert_batches_sorted_eq!(expected, &read); | ||
assert_snapshot!(batches_to_string(&read), @r" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we need
assert_snapshot!(batches_to_string(&read), @r" | |
assert_snapshot!(batches_to_sort_string(&read), @r" |
because it was assert_batches_sorted_eq
before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially used batches_to_sort_string
but it results in a different snapshot than expected:
+------+----+----+
| c1 | c2 | c3 |
+------+----+----+
| | 2 | 20 |
| Foo | 1 | 10 |
| bar | | |
+------+----+----+
So I went with batches_to_string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it! I think for this specific test it's okay - I don't see why it'd produce different sorted output. But in general it may be okay for you to rearrange the rows (#15312)
@blaginin Thanks for your review! I've updated the tests with the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Which issue does this PR close?
Closes #15282.
Rationale for this change
Make it easier to update string comparison tests.
What changes are included in this PR?
Adding
insta
to tests.Are these changes tested?
Are there any user-facing changes?
No.