Improve test_MongoInvariantDDLCoordinatorCheck.h

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      test_MongoInvariantDDLCoordinatorCheck.h tests the custom clang-tidy check MongoInvariantStatusIsOKCheck.cpp. The check rule looks for function calls to invariantWithContextAndLocation or invariantWithLocation. The problem is that this is an implementation detail of the invariant macro, and the test file reproduces the implementation detail instead of including "mongo/util/assert_util.h". If the actual implementation ever changes, the clang-tidy rule will stop working, and this test won't catch it.

      I believe test files for custom clang-tidy rules couldn't include header files from the server code when this test was written, but it appears that's no longer the case today.

            Assignee:
            Unassigned
            Reporter:
            Aitor Esteve Alvarado
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: