-
Notifications
You must be signed in to change notification settings - Fork 269
chore: Improve test assertions in plan stability suite #2505
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2505 +/- ##
============================================
+ Coverage 56.12% 58.40% +2.28%
- Complexity 976 1436 +460
============================================
Files 119 146 +27
Lines 11743 13510 +1767
Branches 2251 2350 +99
============================================
+ Hits 6591 7891 +1300
- Misses 4012 4389 +377
- Partials 1140 1230 +90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| val message = | ||
| s"Expected $planType plan in ${expectedFile.getAbsolutePath} did not match " + | ||
| s"actual $planType plan in ${actualFile.getAbsolutePath}" | ||
| throw new ComparisonFailure(message, expected, actual) |
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.
One problem with ComparisonFailure may be that it logs everything in a single string. Perhaps if the expected and actual had some newlines at the beginning and at the end, then the output might be slightly easier to read?
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. I reverted to the previous approach of calling fail with the formatted plans
|
|
||
| if (regenerateGoldenFiles) { | ||
| generateGoldenFile(plan, query + suffix, explain) | ||
| generateGoldenFile(dir, simplified, explain) |
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.
generateGoldenFile doesn't refer to name? prev implementaton referred to query + suffix
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.
the name (query + suffix) was previously used in generateGoldenFile to create the dir but now we just pass that in, since it has already been computed.
comphead
left a comment
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 @andygrove
Which issue does this PR close?
N/A
Rationale for this change
In the plan stability suite, there is a check that the expected and actual simplified and explain plans match, but only the simplified plan gets logged. This means that when the actual vs expected explain plan is different, no information is logged to show the difference. I discovered this while working on #2492
I split these changes out into a separate PR from #2492 to make reviews easier.
What changes are included in this PR?
How are these changes tested?