
from buildbot.steps import shell

from master.factory import commands


class SyzygyCommands(commands.FactoryCommands):
  """Encapsulates methods to add Syzygy commands to a buildbot factory."""

  def __init__(self, factory=None, target=None, build_dir=None,
               target_platform=None, target_arch=None):
    commands.FactoryCommands.__init__(self, factory, target, build_dir,
                                      target_platform)

    self._arch = target_arch
    self._factory = factory
  
  def AddRandomizeChromeStep(self, timeout=600):
    # Randomization script path.
    script_path = self.PathJoin('internal', 'build', 'randomize_chrome.py')
    command = [self._python, script_path,
               '--build-dir=%s' % self._build_dir,
               '--target=%s' % self._target]
    self.factory.addStep(shell.ShellCommand,
        name='randomize',
        description=['Randomly', 'Reordering', 'Chrome'],
        command=cmd,
        timeout=timeout)


from buildbot.steps import shell

from master.factory import commands


class SyzygyCommands(commands.FactoryCommands):
  """Encapsulates methods to add Syzygy commands to a buildbot factory."""

  def __init__(self, factory=None, target=None, build_dir=None,
               target_platform=None, target_arch=None):
    commands.FactoryCommands.__init__(self, factory, target, build_dir,
                                      target_platform)

    self._arch = target_arch
    self._factory = factory
  
  def AddRandomizeChromeStep(self, timeout=600):
    # Randomization script path.
    script_path = self.PathJoin(self._build_dir, 'internal', 'build',
                                'randomize_chrome.py')
    command = [self._python, script_path,
               '--build-dir=%s' % self._build_dir,
               '--target=%s' % self._target,
               '--verbose']
    self._factory.addStep(shell.ShellCommand,
        name='randomize',
        description=['Randomly', 'Reordering', 'Chrome'],
        command=command,
        timeout=timeout)

Fix typos and paths broken in previous CL.
Fix typos and paths broken in previous CL.

Review URL: http://codereview.chromium.org/7085037

git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@87249 0039d316-1c4b-4281-b951-d872f2087c98

  
  from buildbot.steps import shell
  
  from master.factory import commands
  
  
  class SyzygyCommands(commands.FactoryCommands):
    """Encapsulates methods to add Syzygy commands to a buildbot factory."""
  
    def __init__(self, factory=None, target=None, build_dir=None,
                 target_platform=None, target_arch=None):
      commands.FactoryCommands.__init__(self, factory, target, build_dir,
                                        target_platform)
  
      self._arch = target_arch
      self._factory = factory
    
    def AddRandomizeChromeStep(self, timeout=600):
      # Randomization script path.
-     script_path = self.PathJoin('internal', 'build', 'randomize_chrome.py')
+     script_path = self.PathJoin(self._build_dir, 'internal', 'build',
+                                 'randomize_chrome.py')
      command = [self._python, script_path,
                 '--build-dir=%s' % self._build_dir,
-                '--target=%s' % self._target]
+                '--target=%s' % self._target,
+                '--verbose']
-     self.factory.addStep(shell.ShellCommand,
+     self._factory.addStep(shell.ShellCommand,
          name='randomize',
          description=['Randomly', 'Reordering', 'Chrome'],
-         command=cmd,
+         command=command,
          timeout=timeout)
  
Fix typos and paths broken in previous CL.
## Code Before:

from buildbot.steps import shell

from master.factory import commands


class SyzygyCommands(commands.FactoryCommands):
  """Encapsulates methods to add Syzygy commands to a buildbot factory."""

  def __init__(self, factory=None, target=None, build_dir=None,
               target_platform=None, target_arch=None):
    commands.FactoryCommands.__init__(self, factory, target, build_dir,
                                      target_platform)

    self._arch = target_arch
    self._factory = factory
  
  def AddRandomizeChromeStep(self, timeout=600):
    # Randomization script path.
    script_path = self.PathJoin('internal', 'build', 'randomize_chrome.py')
    command = [self._python, script_path,
               '--build-dir=%s' % self._build_dir,
               '--target=%s' % self._target]
    self.factory.addStep(shell.ShellCommand,
        name='randomize',
        description=['Randomly', 'Reordering', 'Chrome'],
        command=cmd,
        timeout=timeout)

## Instruction:
Fix typos and paths broken in previous CL.
## Code After:

from buildbot.steps import shell

from master.factory import commands


class SyzygyCommands(commands.FactoryCommands):
  """Encapsulates methods to add Syzygy commands to a buildbot factory."""

  def __init__(self, factory=None, target=None, build_dir=None,
               target_platform=None, target_arch=None):
    commands.FactoryCommands.__init__(self, factory, target, build_dir,
                                      target_platform)

    self._arch = target_arch
    self._factory = factory
  
  def AddRandomizeChromeStep(self, timeout=600):
    # Randomization script path.
    script_path = self.PathJoin(self._build_dir, 'internal', 'build',
                                'randomize_chrome.py')
    command = [self._python, script_path,
               '--build-dir=%s' % self._build_dir,
               '--target=%s' % self._target,
               '--verbose']
    self._factory.addStep(shell.ShellCommand,
        name='randomize',
        description=['Randomly', 'Reordering', 'Chrome'],
        command=command,
        timeout=timeout)
