[SERVER-70962] [CQF] Make ASSERT_EXPLAIN macros easier to update Created: 29/Oct/22  Updated: 05/Dec/22  Resolved: 01/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-70966 [CQF] Unit test auto-updating support Closed
Related
related to SERVER-70966 [CQF] Unit test auto-updating support Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

Currently, updating a test that uses ASSERT_EXPLAIN requires several steps. For example what I do is:

  1. Find the definition of kDebugAsserts and change it to 'true' temporarily.
  2. Run the unit test.
  3. Find either `V2` or `V2Compact` in the output; copy it.
  4. Paste it into the .cpp
  5. Use editor shortcuts to fix the quoting and indentation.

There are some easy ways to improve this:

  • Remove the kDebugAsserts flag. Instead, have the macro print whenever the comparison fails. (And not when it succeeds.)
  • Have the macro print using only one explain format (the one relevant to that assertion).
  • Have the printed output be already string-quoted and ready to copy-paste into the .cpp.

Then the steps would be:

  1. Run the unit test.
  2. Find the only expected-output message; copy it.
  3. Paste it into the .cpp


 Comments   
Comment by Svilen Mihaylov (Inactive) [ 01/Nov/22 ]

Also more work planned in https://jira.mongodb.org/browse/SERVER-71004

Comment by David Percy [ 31/Oct/22 ]

We could also skip this if we do SERVER-70966 instead.

Generated at Thu Feb 08 06:17:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.