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

Shell needs an "assert failed with code" function that works for any command response

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.7.1
    • Testing Infrastructure
    • None
    • Minor Change
    • TIG 2018-1-15, TIG 2018-1-29
    • 0

    Description

      I'm writing tests that use a variety of different commands and need to assert that they all fail with a particular code. However, the experience is extremely frustrating because the existing assert helpers all require a particular response format, and can't be used uniformly throughout:

      • Error responses with a code field are caught by assert.commandWorked()
      • Error responses with writeError are caught by assert.writeError()
      • I have no idea if anyone can handle the plural writeErrors generated when using the bulk API
      • Any other error response format I'm missing?

      I would be very happy if we had one magic function that just "did the right thing" based on the response type / format.

      Attachments

        Issue Links

          Activity

            People

              kevin.albertson@mongodb.com Kevin Albertson
              kyle.suarez@mongodb.com Kyle Suarez
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: