Exemple #1
0
 def setUp(self):
     super(NailgunExecutorTest, self).setUp()
     self.executor = NailgunExecutor(identity='test',
                                     workdir='/__non_existent_dir',
                                     nailgun_classpath=[],
                                     distribution=mock.Mock(),
                                     metadata_base_dir=self.subprocess_dir)
Exemple #2
0
 def setUp(self):
     super().setUp()
     self.executor = NailgunExecutor(
         identity="test",
         workdir="/__non_existent_dir",
         nailgun_classpath=[],
         distribution=unittest.mock.Mock(),
         metadata_base_dir=self.subprocess_dir,
     )
Exemple #3
0
    def create_java_executor(self):
        """Create java executor that uses this task's ng daemon, if allowed.

    Call only in execute() or later. TODO: Enforce this.
    """
        if self.nailgun_is_enabled and self.get_options().ng_daemons:
            classpath = os.pathsep.join(self.tool_classpath('nailgun-server'))
            client = NailgunExecutor(self._executor_workdir,
                                     classpath,
                                     distribution=self._dist)
        else:
            client = SubprocessExecutor(self._dist)
        return client
Exemple #4
0
    def create_java_executor(self):
        """Create java executor that uses this task's ng daemon, if allowed.

    Call only in execute() or later. TODO: Enforce this.
    """
        if self.context.options.nailgun_daemon:
            classpath = os.pathsep.join(
                self.tool_classpath(self._nailgun_bootstrap_key))
            client = NailgunExecutor(self._executor_workdir,
                                     classpath,
                                     distribution=self._dist)
        else:
            client = SubprocessExecutor(self._dist)
        return client
Exemple #5
0
  def create_java_executor(self):
    """Create java executor that uses this task's ng daemon, if allowed.

    Call only in execute() or later. TODO: Enforce this.
    """
    if self.get_options().use_nailgun:
      classpath = os.pathsep.join(self.tool_classpath('nailgun-server'))
      return NailgunExecutor(self._identity,
                             self._executor_workdir,
                             classpath,
                             self.dist,
                             connect_timeout=self.get_options().nailgun_timeout_seconds,
                             connect_attempts=self.get_options().nailgun_connect_attempts)
    else:
      return SubprocessExecutor(self.dist)
Exemple #6
0
    def create_java_executor(self, dist=None, force_subprocess=False):
        """Create java executor that uses this task's ng daemon, if allowed.

    Call only in execute() or later. TODO: Enforce this.
    """
        dist = dist or self.dist
        if self.execution_strategy == self.ExecutionStrategy.nailgun and not force_subprocess:
            classpath = os.pathsep.join(self.tool_classpath('nailgun-server'))
            return NailgunExecutor(
                self._identity,
                self._executor_workdir,
                classpath,
                dist,
                startup_timeout=self.get_options(
                ).nailgun_subprocess_startup_timeout,
                connect_timeout=self.get_options().nailgun_timeout_seconds,
                connect_attempts=self.get_options().nailgun_connect_attempts)
        else:
            return SubprocessExecutor(dist)
 def setUp(self):
     self.executor = NailgunExecutor(identity='test',
                                     workdir='/__non_existent_dir',
                                     nailgun_classpath=[],
                                     distribution=mock.Mock())