Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-70962

[CQF] Make ASSERT_EXPLAIN macros easier to update

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    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

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: