Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4264 Remove connect usage from tests
  3. NODE-4347

Create tests that cover each async API and review audit from api-extractor

    • Type: Icon: Sub-task Sub-task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed

      The approach to obtaining this coverage will be to use api extractor to generate a json file describing our driver's API. Then filter that api with the following conditions:

      • symbol kind is Class
      • releaseTag is Public
        • for each symbol on the above filtered
        • symbol kind is Method
        • releaseTag is Public
        • excerptTokens contains Promise (essentially determines if it's an i/o function)
        • enforce unique names (deletes overrides)
      • class has a non-zero number of methods
        Using the above, create a test per API (preliminarily 188 tests) that await the result of each method and assert that a topology has been created on the MongoClient. The API can fail with MongoServerError, since that still indicates there was networking performed, and the topology should still have been created.

      Double check to see if GridFS APIs are covered, they work via streams so won't be picked up by the promise filtering.

      Inspect the APIs that do not match the above filtering (sync helpers, getters, etc.) and scan for anything that might be impacted by connect/not connected client state.

      Make reasonable approximation that we’ve covered all the APIs that could be impacted since we don’t have the tooling to assert it definitively. The assumed risk is that a user may discover and hopefully report an API that behaves inconsistently that we may have missed. Which is risk we think is acceptable since the work around of explicit connection always exists and we can repair what ever was reported.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: