[SERVER-68012] Consider updating existing tests which do string comparison Created: 13/Jul/22 Updated: 05/Dec/22 Resolved: 05/Dec/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Hana Pearlman | Assignee: | Backlog - Query Optimization |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Participants: |
| Description |
|
The list of potentially relevant files is: logical_rewriter_optimizer_test, physical_rewriter_optimizer_test, optimizer_test, path_optimizer_test, interval_intersection_test, and sbe_abt_diff_test. These tests all serialize an ABT after some optimizations or serialize query results and then do string comparison. So, they are good candidates for converting to some other format. Maybe some tests should be converted to jstests (golden or otherwise), and some other tests should be converted to golden unit tests. |
| Comments |
| Comment by David Percy [ 17/Nov/22 ] |
|
As I understand it, the advantage of the golden-test framework is the ease of auto-updating. If your code change results in a small change to every test output, you can auto-update the golden-data files and use git diff to review. However, one disadvantage is that the input and expected-output are separated. This creates some friction while debugging, and can make the output harder to review--we have to mitigate this by printing both input and output. I think we can combine the advantages of both approaches: inline assertions and auto-updating. See |