Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1237

Update aggregate tests for MongoDB 3.5+ support (v2.9)

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.9.5
    • Affects Version/s: None
    • Component/s: Tests
    • None

      SERVER-24623 removed support for single document aggregate command results. That is, the aggregate command now requires either the 'cursor' or 'explain' options. We have a few test cases in the v2.9 branch that fail because of this change. This ticket tracks fixing them.

      ======================================================================
      ERROR: test_aggregate (test.test_collection.TestCollection)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/test/test_collection.py", line 1463, in test_aggregate
          db.test.aggregate(pipeline),
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/collection.py", line 1827, in aggregate
          "aggregate", self.__name, **command_kwargs)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 438, in _command
          result, self.connection._disconnect, None, allowable_errors)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/helpers.py", line 213, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      OperationFailure: The 'cursor' option is required, unless 'explain' is true
      
      ======================================================================
      ERROR: test_aggregate_with_compile_re (test.test_collection.TestCollection)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/test/test_collection.py", line 1481, in test_aggregate_with_compile_re
          result = db.test.aggregate([])
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/collection.py", line 1827, in aggregate
          "aggregate", self.__name, **command_kwargs)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 438, in _command
          result, self.connection._disconnect, None, allowable_errors)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/helpers.py", line 213, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      OperationFailure: The 'cursor' option is required, unless 'explain' is true
      
      ======================================================================
      ERROR: test_aggregation_cursor_validation (test.test_collection.TestCollection)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/test/test_collection.py", line 1496, in test_aggregation_cursor_validation
          cursor = db.test.aggregate(projection)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/collection.py", line 1827, in aggregate
          "aggregate", self.__name, **command_kwargs)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 438, in _command
          result, self.connection._disconnect, None, allowable_errors)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/helpers.py", line 213, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      OperationFailure: The 'cursor' option is required, unless 'explain' is true
      
      ======================================================================
      ERROR: test_command_max_time_ms (test.test_database.TestDatabase)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/test/test_database.py", line 739, in test_command_max_time_ms
          db.command('aggregate', 'test', pipeline=pipeline)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 533, in command
          codec_options, **kwargs)[0]
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 438, in _command
          result, self.connection._disconnect, None, allowable_errors)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/helpers.py", line 213, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      OperationFailure: The 'cursor' option is required, unless 'explain' is true
      
      ======================================================================
      ERROR: test_command_with_compile_re (test.test_database.TestDatabase)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/test/test_database.py", line 353, in test_command_with_compile_re
          result = db.command('aggregate', 'test', pipeline=[])
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 533, in command
          codec_options, **kwargs)[0]
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/database.py", line 438, in _command
          result, self.connection._disconnect, None, allowable_errors)
        File "/mnt/jenkins/workspace/mongo-python-driver-v2.9-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_server/master-nightly/python_language_version/2.7/pymongo/helpers.py", line 213, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      OperationFailure: The 'cursor' option is required, unless 'explain' is true
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: