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

Allow resmoke to search for mongod on the PATH by default

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: 4.3 Required
    • Component/s: Replication
    • Fully Compatible
    • Repl 2019-08-26

       Logic for spawning a specific version of MongoDB exists already in our JavaScript tests in the shell by searching for a <executable name>-<version suffix> file (e.g. mongod-4.0) on the PATH.

      We will implement the same logic in resmoke so that mixed version replica set test suites that use ReplicaSetFixture and ShardedClusterFixture can be run. Evergreen uses /data/multiversion as the destination for storing the binaries downloaded from the multiversion setup script. Currently, although resmoke supports running an executable found on the PATH, it by default searches the current working directory for the mongod executable. We will change the behavior by using subprocess.Popen to search for the intended executable on the PATH by default. We will append both the current working directory and /data/multiversion to the PATH (in that order) to maintain compatibility with the existing multiversion setup script. It would do so by taking advantage of the existing env_vars option on resmoke.py’s Process class.

             process_kwargs = self.shell_options.get("process_kwargs", {}).copy()
      
             env_vars = process_kwargs.get("env_vars", {}).copy()
      
             path = env_vars.get("PATH", os.environ.get("PATH", ""))
      
             os.pathsep.join(path, ".", os.normpath("/data/multiversion"))
      
             env_vars["PATH"] = path
      
             process_kwargs["env_vars"] = env_vars
      

            Assignee:
            jason.chan@mongodb.com Jason Chan
            Reporter:
            jason.chan@mongodb.com Jason Chan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: