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

options_parser_test.cpp is a beast

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability

      This cpp file is >5000 lines and takes well over 60sec to compile.
      It's doing incredibly redundant copy-paste work.

      I just had to make a change to the OptionParser API and edit hundreds of lines of repetitive usage. A simple refactor of the test would cut the redundancy, the build cost, and get us better test coverage.

      Exploring the file, I find that several things are not tested that should be. When we test repeated fields, we test the elements we're interested in, but we do not check to see if any extra unexpected elements were in the results. We also don't do bounds checks on the results before looking at them. If containers were checked with a a function call, we would have no problem implementing a string check in one place and all the tests would benefit from it. Several examples in there.  OptionsParser is important to get right.

            Assignee:
            Unassigned Unassigned
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: