[SERVER-78549] [CQF] ASSERT_AUTO_* macro edits appear on wrong line when run with an empty string Created: 29/Jun/23  Updated: 10/Nov/23  Resolved: 10/Nov/23

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

Type: Improvement Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Milena Ivanova
Resolution: Fixed Votes: 0
Labels: greenerbuild, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 153

 Description   

A very common workflow is to introduce a new unit test with an empty string and an ASSERT_AUTO_* macro. Then compile and run the unittest with --autoUpdateAsserts to fill in the explain output and manually verify the result. This workflow appears to generate code on the wrong line, causing the build to fail.

Steps to reproduce:
auto node = ...;
ASSERT_EXPLAIN_V2_AUTO("", node);
Run unit test with --autoUpdateAsserts

The generated explain ends up on the wrong line:
"Root [

{root}]\n"
"Union [{root}

]\n"
...
"PhysicalScan []\n"
ASSERT_EXPLAIN_V2_AUTO("", node);

rather than

ASSERT_EXPLAIN_V2_AUTO("Root []", node);



 Comments   
Comment by Githook User [ 09/Nov/23 ]

Author:

{'name': 'Milena Ivanova', 'email': 'milena.ivanova@mongodb.com', 'username': 'mivanova3'}

Message: SERVER-78549 Fix const declaration.
Branch: master
https://github.com/mongodb/mongo/commit/694c5ad50503131045025a8e2606833f349b8959

Comment by Githook User [ 08/Nov/23 ]

Author:

{'name': 'Milena Ivanova', 'email': 'milena.ivanova@mongodb.com', 'username': 'mivanova3'}

Message: SERVER-78549 Implement *INITIAL_AUTO macro for auto-update of new
optimizer tests with the actual plan
Branch: master
https://github.com/mongodb/mongo/commit/17ffae82fa6942b4d35f84ae7742f954846b8d04

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