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

Fix test.version to handle "git describe" generated server version numbers

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.9.2, 3.2.1
    • Affects Version/s: None
    • Component/s: None
    • None

      The server changed how buildInfo.version is generated (SERVER-21224). This breaks the assumptions test.version makes when parsing the version number leading to problems like this:

      Traceback (most recent call last):
        File "/mnt/jenkins/workspace/mongo-python-driver-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_option/noauth/mongodb_server/30-nightly/python_language_version/2.7/setup.py", line 309, in <module>
          **extra_opts
        File "/mnt/jenkins/languages/python/r2.7/lib/python2.7/distutils/core.py", line 151, in setup
          dist.run_commands()
        File "/mnt/jenkins/languages/python/r2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
          self.run_command(cmd)
        File "/mnt/jenkins/languages/python/r2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/mnt/jenkins/workspace/mongo-python-driver-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_option/noauth/mongodb_server/30-nightly/python_language_version/2.7/setup.py", line 98, in run
          from test import unittest, PymongoTestRunner, test_cases
        File "/mnt/jenkins/workspace/mongo-python-driver-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_option/noauth/mongodb_server/30-nightly/python_language_version/2.7/test/__init__.py", line 327, in <module>
          client_context = ClientContext()
        File "/mnt/jenkins/workspace/mongo-python-driver-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_option/noauth/mongodb_server/30-nightly/python_language_version/2.7/test/__init__.py", line 124, in __init__
          self.version = Version.from_client(self.client)
        File "/mnt/jenkins/workspace/mongo-python-driver-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_option/noauth/mongodb_server/30-nightly/python_language_version/2.7/test/version.py", line 57, in from_client
          return cls.from_string(client.server_info()['version'])
        File "/mnt/jenkins/workspace/mongo-python-driver-nightly/extensions/with-extensions/label/linux64/mongodb_configuration/single_server/mongodb_option/noauth/mongodb_server/30-nightly/python_language_version/2.7/test/version.py", line 49, in from_string
          version = [int(part) for part in version_string.split(".")]
      ValueError: invalid literal for int() with base 10: '7-33-gcf61900'
      

            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: