def testBuildbotDebugWithPatches(self):
     """Test we can test patches with --buildbot --debug."""
     args = [
         '--remote', '-g', '1234', '--debug', '--buildbot',
         self._X86_PREFLIGHT
     ]
     cbuildbot._ParseCommandLine(self.parser, args)
 def testCreateBranchDelete(self):
     """Test we don't require --version with --delete."""
     args = [
         '--delete-branch', '--branch-name', 'refs/heads/test',
         constants.BRANCH_UTIL_CONFIG
     ]
     cbuildbot._ParseCommandLine(self.parser, args)
Ejemplo n.º 3
0
    def _initConfig(self,
                    bot_id,
                    extra_argv=None,
                    override_hw_test_config=None):
        """Return normal options/build_config for |bot_id|"""
        site_config = chromeos_config.GetConfig()
        build_config = copy.deepcopy(site_config[bot_id])
        build_config['master'] = False
        build_config['important'] = False

        # Use the cbuildbot parser to create properties and populate default values.
        parser = cbuildbot._CreateParser()
        argv = (
            ['-r', self.buildroot, '--buildbot', '--debug', '--nochromesdk'] +
            (extra_argv if extra_argv else []) + [bot_id])
        options, _ = cbuildbot._ParseCommandLine(parser, argv)

        # Yikes.
        options.managed_chrome = build_config['sync_chrome']

        # Iterate through override and update HWTestConfig attributes.
        if override_hw_test_config:
            for key, val in override_hw_test_config.iteritems():
                for hw_test in build_config.hw_tests:
                    setattr(hw_test, key, val)

        return cbuildbot_run.BuilderRun(options, site_config, build_config,
                                        self._manager)
    def testIsDistributedBuilder(self):
        """Tests for _IsDistributedBuilder() under various configurations."""
        parser = cbuildbot._CreateParser()
        argv = ['x86-generic-paladin']
        (options, _) = cbuildbot._ParseCommandLine(parser, argv)
        options.buildbot = False

        build_config = dict(pre_cq=False, manifest_version=False)
        chrome_rev = None

        def _TestConfig(expected):
            self.assertEquals(
                expected,
                cbuildbot._IsDistributedBuilder(options=options,
                                                chrome_rev=chrome_rev,
                                                build_config=build_config))

        # Default options.
        _TestConfig(False)

        build_config['pre_cq'] = True
        _TestConfig(True)

        build_config['pre_cq'] = False
        build_config['manifest_version'] = True
        # Not running in buildbot mode even though manifest_version=True.
        _TestConfig(False)
        options.buildbot = True
        _TestConfig(True)

        for chrome_rev in (constants.CHROME_REV_TOT,
                           constants.CHROME_REV_LOCAL,
                           constants.CHROME_REV_SPEC):
            _TestConfig(False)
Ejemplo n.º 5
0
  def setUp(self):
    self.buildroot = os.path.join(self.tempdir, 'buildroot')
    osutils.SafeMakedirs(self.buildroot)
    # Always stub RunCommmand out as we use it in every method.
    self.bot_id = 'x86-generic-paladin'
    self.build_config = copy.deepcopy(cbuildbot_config.GetConfig()[self.bot_id])
    self.build_config['master'] = False
    self.build_config['important'] = False

    # Use the cbuildbot parser to create properties and populate default values.
    self.parser = cbuildbot._CreateParser()

    argv = ['-r', self.buildroot, '--buildbot', '--debug',
            'x86-generic-paladin']
    (self.options, _) = cbuildbot._ParseCommandLine(self.parser, argv)
    self.options.bootstrap = False
    self.options.clean = False
    self.options.resume = False
    self.options.sync = False
    self.options.build = False
    self.options.uprev = False
    self.options.tests = False
    self.options.archive = False
    self.options.remote_test_status = False
    self.options.patches = None
    self.options.prebuilts = False

    self._manager = parallel.Manager()
    self._manager.__enter__()
    self.run = cbuildbot_run.BuilderRun(self.options, self.build_config,
                                        self._manager)

    self.rc.AddCmdResult(
        [constants.PATH_TO_CBUILDBOT, '--reexec-api-version'],
        output=constants.REEXEC_API_VERSION)
    def _initConfig(self, bot_id, extra_argv=None, override_hw_test_config=None):
        """Return normal options/build_config for |bot_id|"""
        site_config = chromeos_config.GetConfig()
        build_config = copy.deepcopy(site_config[bot_id])
        build_config["master"] = False
        build_config["important"] = False

        # Use the cbuildbot parser to create properties and populate default values.
        parser = cbuildbot._CreateParser()
        argv = (
            ["-r", self.buildroot, "--buildbot", "--debug", "--nochromesdk"]
            + (extra_argv if extra_argv else [])
            + [bot_id]
        )
        options, _ = cbuildbot._ParseCommandLine(parser, argv)

        # Yikes.
        options.managed_chrome = build_config["sync_chrome"]

        # Iterate through override and update HWTestConfig attributes.
        if override_hw_test_config:
            for key, val in override_hw_test_config.iteritems():
                for hw_test in build_config.hw_tests:
                    setattr(hw_test, key, val)

        return cbuildbot_run.BuilderRun(options, site_config, build_config, self._manager)
  def testIsDistributedBuilder(self):
    """Tests for _IsDistributedBuilder() under various configurations."""
    parser = cbuildbot._CreateParser()
    argv = ['x86-generic-paladin']
    (options, _) = cbuildbot._ParseCommandLine(parser, argv)
    options.buildbot = False

    build_config = dict(pre_cq=False,
                        manifest_version=False)
    chrome_rev = None

    def _TestConfig(expected):
      self.assertEquals(expected,
                        cbuildbot._IsDistributedBuilder(
                            options=options,
                            chrome_rev=chrome_rev,
                            build_config=build_config))

    # Default options.
    _TestConfig(False)

    build_config['pre_cq'] = True
    _TestConfig(True)

    build_config['pre_cq'] = False
    build_config['manifest_version'] = True
    # Not running in buildbot mode even though manifest_version=True.
    _TestConfig(False)
    options.buildbot = True
    _TestConfig(True)

    for chrome_rev in (constants.CHROME_REV_TOT,
                       constants.CHROME_REV_LOCAL,
                       constants.CHROME_REV_SPEC):
      _TestConfig(False)
Ejemplo n.º 8
0
    def setUp(self):
        self.buildroot = os.path.join(self.tempdir, 'buildroot')
        osutils.SafeMakedirs(self.buildroot)
        # Always stub RunCommmand out as we use it in every method.
        self.bot_id = 'x86-generic-paladin'
        self.build_config = config.config[self.bot_id]
        self.build_config['master'] = False
        self.build_config['important'] = False

        # Use the cbuildbot parser to create properties and populate default values.
        self.parser = cbuildbot._CreateParser()

        argv = [
            '-r', self.buildroot, '--buildbot', '--debug',
            'x86-generic-paladin'
        ]
        (self.options, _) = cbuildbot._ParseCommandLine(self.parser, argv)
        self.options.bootstrap = False
        self.options.clean = False
        self.options.resume = False
        self.options.sync = False
        self.options.build = False
        self.options.uprev = False
        self.options.tests = False
        self.options.archive = False
        self.options.remote_test_status = False
        self.options.patches = None
        self.options.prebuilts = False

        self.mox.StubOutWithMock(stages.SyncStage, 'HandleSkip')
        stages.SyncStage.HandleSkip()
Ejemplo n.º 9
0
  def setUp(self):
    self.buildroot = os.path.join(self.tempdir, 'buildroot')
    osutils.SafeMakedirs(self.buildroot)
    # Always stub RunCommmand out as we use it in every method.
    self.bot_id = 'x86-generic-paladin'
    self.build_config = config.config[self.bot_id]
    self.build_config['master'] = False
    self.build_config['important'] = False

    # Use the cbuildbot parser to create properties and populate default values.
    self.parser = cbuildbot._CreateParser()

    argv = ['-r', self.buildroot, '--buildbot', '--debug',
            'x86-generic-paladin']
    (self.options, _) = cbuildbot._ParseCommandLine(self.parser, argv)
    self.options.bootstrap = False
    self.options.clean = False
    self.options.resume = False
    self.options.sync = False
    self.options.build = False
    self.options.uprev = False
    self.options.tests = False
    self.options.archive = False
    self.options.remote_test_status = False
    self.options.patches = None
    self.options.prebuilts = False

    self.mox.StubOutWithMock(stages.SyncStage, 'HandleSkip')
    stages.SyncStage.HandleSkip()
Ejemplo n.º 10
0
    def setUp(self):
        self.buildroot = os.path.join(self.tempdir, 'buildroot')
        osutils.SafeMakedirs(self.buildroot)
        # Always stub RunCommmand out as we use it in every method.
        self.site_config = config_lib_unittest.MockSiteConfig()
        self.build_config = config_lib_unittest.MockBuildConfig()
        self.bot_id = self.build_config.name
        self.build_config['master'] = False
        self.build_config['important'] = False

        # Use the cbuildbot parser to create properties and populate default values.
        self.parser = cbuildbot._CreateParser()

        argv = ['-r', self.buildroot, '--buildbot', '--debug', self.bot_id]
        self.options, _ = cbuildbot._ParseCommandLine(self.parser, argv)
        self.options.bootstrap = False
        self.options.clean = False
        self.options.resume = False
        self.options.sync = False
        self.options.build = False
        self.options.uprev = False
        self.options.tests = False
        self.options.archive = False
        self.options.remote_test_status = False
        self.options.patches = None
        self.options.prebuilts = False

        self._manager = parallel.Manager()
        self._manager.__enter__()
        self.run = cbuildbot_run.BuilderRun(self.options, self.site_config,
                                            self.build_config, self._manager)

        self.rc.AddCmdResult(
            [constants.PATH_TO_CBUILDBOT, '--reexec-api-version'],
            output=constants.REEXEC_API_VERSION)
Ejemplo n.º 11
0
 def testBuildBotWithDebugOption(self):
   """Test that --debug option overrides --buildbot option."""
   args = ['-r', self._BUILD_ROOT, '--buildbot', '--debug',
           self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.debug, True)
   self.assertEquals(options.buildbot, True)
  def setUp(self):
    self.buildroot = os.path.join(self.tempdir, 'buildroot')
    osutils.SafeMakedirs(self.buildroot)
    # Always stub RunCommmand out as we use it in every method.
    self.bot_id = 'x86-generic-paladin'
    self.build_config = copy.deepcopy(config.config[self.bot_id])
    self.build_config['master'] = False
    self.build_config['important'] = False

    # Use the cbuildbot parser to create properties and populate default values.
    self.parser = cbuildbot._CreateParser()

    argv = ['-r', self.buildroot, '--buildbot', '--debug',
            'x86-generic-paladin']
    (self.options, _) = cbuildbot._ParseCommandLine(self.parser, argv)
    self.options.bootstrap = False
    self.options.clean = False
    self.options.resume = False
    self.options.sync = False
    self.options.build = False
    self.options.uprev = False
    self.options.tests = False
    self.options.archive = False
    self.options.remote_test_status = False
    self.options.patches = None
    self.options.prebuilts = False

    self._manager = cbuildbot.parallel.Manager()
    self._manager.__enter__()
    self.run = cbuildbot_run.BuilderRun(self.options, self.build_config,
                                        self._manager)

    self.StartPatcher(BuilderRunMock())
Ejemplo n.º 13
0
    def setUp(self):
        self.buildroot = os.path.join(self.tempdir, "buildroot")
        osutils.SafeMakedirs(self.buildroot)
        # Always stub RunCommmand out as we use it in every method.
        self.site_config = config_lib_unittest.MockSiteConfig()
        self.build_config = config_lib_unittest.MockBuildConfig()
        self.bot_id = self.build_config.name
        self.build_config["master"] = False
        self.build_config["important"] = False

        # Use the cbuildbot parser to create properties and populate default values.
        self.parser = cbuildbot._CreateParser()

        argv = ["-r", self.buildroot, "--buildbot", "--debug", self.bot_id]
        self.options, _ = cbuildbot._ParseCommandLine(self.parser, argv)
        self.options.bootstrap = False
        self.options.clean = False
        self.options.resume = False
        self.options.sync = False
        self.options.build = False
        self.options.uprev = False
        self.options.tests = False
        self.options.archive = False
        self.options.remote_test_status = False
        self.options.patches = None
        self.options.prebuilts = False

        self._manager = parallel.Manager()
        self._manager.__enter__()
        self.run = cbuildbot_run.BuilderRun(self.options, self.site_config, self.build_config, self._manager)

        self.rc.AddCmdResult([constants.PATH_TO_CBUILDBOT, "--reexec-api-version"], output=constants.REEXEC_API_VERSION)
Ejemplo n.º 14
0
 def testLocalTrybotWithSpacesInPatches(self):
   """Test that we handle spaces in patch arguments."""
   args = ['-r', self._BUILD_ROOT, '--remote', '--local-patches',
           ' proj:br \t  proj2:b2 ',
           self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.local_patches, ['proj:br', 'proj2:b2'])
Ejemplo n.º 15
0
 def setUp(self):
   self.parser = cbuildbot._CreateParser()
   args = ['-r', '/tmp/test_build1', '-g', '5555', '-g',
           '6666', '--remote']
   args.extend(self.BOTS)
   self.options, args = cbuildbot._ParseCommandLine(self.parser, args)
   self.checkout_dir = os.path.join(self.tempdir, 'test_checkout')
   self.int_mirror, self.ext_mirror = None, None
Ejemplo n.º 16
0
 def testLocalTrybotWithSpacesInPatches(self):
     """Test that we handle spaces in patch arguments."""
     args = [
         '-r', self._BUILD_ROOT, '--remote', '--local-patches',
         ' proj:br \t  proj2:b2 ', self._X86_PREFLIGHT
     ]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.local_patches, ['proj:br', 'proj2:b2'])
Ejemplo n.º 17
0
 def setUp(self):
     self.parser = cbuildbot._CreateParser()
     args = [
         '-r', '/tmp/test_build1', '-g', '5555', '-g', '6666', '--remote'
     ]
     args.extend(self.BOTS)
     self.options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.checkout_dir = os.path.join(self.tempdir, 'test_checkout')
     self.int_mirror, self.ext_mirror = None, None
Ejemplo n.º 18
0
 def testBuildBotWithDebugOption(self):
     """Test that --debug option overrides --buildbot option."""
     args = [
         '-r', self._BUILD_ROOT, '--buildbot', '--debug',
         self._X86_PREFLIGHT
     ]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertTrue(options.debug)
     self.assertTrue(options.buildbot)
Ejemplo n.º 19
0
 def setUp(self):
     # pylint: disable=protected-access
     self.parser = cbuildbot._CreateParser()
     args = ["-r", "/tmp/test_build1", "-g", "5555", "-g", "6666", "--remote"]
     args.extend(self.BOTS)
     self.options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.options.cache_dir = self.tempdir
     self.checkout_dir = os.path.join(self.tempdir, "test_checkout")
     self.int_mirror, self.ext_mirror = None, None
Ejemplo n.º 20
0
 def testBuildBotWithGoodChromeRootOption(self):
     """chrome_root can be set without chrome_rev."""
     args = [
         '--local',
         '--buildroot=/tmp',
         '--chrome_root=.',
         self._X86_PREFLIGHT,
     ]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.chrome_rev, constants.CHROME_REV_LOCAL)
     self.assertNotEquals(options.chrome_root, None)
 def setUp(self):
   # pylint: disable=protected-access
   self.site_config = config_lib_unittest.MockSiteConfig()
   self.parser = cbuildbot._CreateParser()
   args = ['-r', '/tmp/test_build1', '-g', '5555', '-g',
           '6666', '--remote']
   args.extend(self.BOTS)
   self.options, args = cbuildbot._ParseCommandLine(self.parser, args)
   self.options.cache_dir = self.tempdir
   self.checkout_dir = os.path.join(self.tempdir, 'test_checkout')
   self.int_mirror, self.ext_mirror = None, None
Ejemplo n.º 22
0
 def setUp(self):
   # pylint: disable=protected-access
   self.site_config = config_lib_unittest.MockSiteConfig()
   self.parser = cbuildbot._CreateParser()
   args = ['-r', '/tmp/test_build1', '-g', '5555', '-g',
           '6666', '--remote']
   args.extend(self.BOTS)
   self.options, args = cbuildbot._ParseCommandLine(self.parser, args)
   self.options.cache_dir = self.tempdir
   self.checkout_dir = os.path.join(self.tempdir, 'test_checkout')
   self.int_mirror, self.ext_mirror = None, None
Ejemplo n.º 23
0
 def testBuildBotWithGoodChromeRootOption(self):
   """chrome_root can be set without chrome_rev."""
   args = ['--local',
       '--buildroot=/tmp',
       '--chrome_root=.',
       self._X86_PREFLIGHT]
   self.mox.ReplayAll()
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.mox.VerifyAll()
   self.assertEquals(options.chrome_rev, constants.CHROME_REV_LOCAL)
   self.assertNotEquals(options.chrome_root, None)
  def _initConfig(self, bot_id, extra_argv=None):
    """Return normal options/build_config for |bot_id|"""
    build_config = copy.deepcopy(config.config[bot_id])
    build_config['master'] = False
    build_config['important'] = False

    # Use the cbuildbot parser to create properties and populate default values.
    parser = cbuildbot._CreateParser()
    argv = (['-r', self.buildroot, '--buildbot', '--debug', '--nochromesdk'] +
            (extra_argv if extra_argv else []) + [bot_id])
    (options, _) = cbuildbot._ParseCommandLine(parser, argv)

    # Yikes.
    options.managed_chrome = build_config['sync_chrome']

    return cbuildbot_run.BuilderRun(options, build_config, self._manager)
Ejemplo n.º 25
0
 def testBuildBotWithGoodChromeRevAndRootOption(self):
     """chrome_rev can get reset around chrome_root."""
     args = [
         '--local', '--buildroot=/tmp',
         '--chrome_rev=%s' % constants.CHROME_REV_LATEST,
         '--chrome_rev=%s' % constants.CHROME_REV_STICKY,
         '--chrome_rev=%s' % constants.CHROME_REV_TOT,
         '--chrome_rev=%s' % constants.CHROME_REV_TOT,
         '--chrome_rev=%s' % constants.CHROME_REV_STICKY,
         '--chrome_rev=%s' % constants.CHROME_REV_LATEST,
         '--chrome_rev=%s' % constants.CHROME_REV_LOCAL, '--chrome_root=.',
         '--chrome_rev=%s' % constants.CHROME_REV_TOT,
         '--chrome_rev=%s' % constants.CHROME_REV_LOCAL, self._X86_PREFLIGHT
     ]
     self.mox.ReplayAll()
     (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
     self.mox.VerifyAll()
     self.assertEquals(options.chrome_rev, constants.CHROME_REV_LOCAL)
     self.assertNotEquals(options.chrome_root, None)
Ejemplo n.º 26
0
 def testBuildBotWithGoodChromeRevAndRootOption(self):
     """chrome_rev can get reset around chrome_root."""
     args = [
         "--local",
         "--buildroot=/tmp",
         "--chrome_rev=%s" % constants.CHROME_REV_LATEST,
         "--chrome_rev=%s" % constants.CHROME_REV_STICKY,
         "--chrome_rev=%s" % constants.CHROME_REV_TOT,
         "--chrome_rev=%s" % constants.CHROME_REV_TOT,
         "--chrome_rev=%s" % constants.CHROME_REV_STICKY,
         "--chrome_rev=%s" % constants.CHROME_REV_LATEST,
         "--chrome_rev=%s" % constants.CHROME_REV_LOCAL,
         "--chrome_root=.",
         "--chrome_rev=%s" % constants.CHROME_REV_TOT,
         "--chrome_rev=%s" % constants.CHROME_REV_LOCAL,
         self._X86_PREFLIGHT,
     ]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.chrome_rev, constants.CHROME_REV_LOCAL)
     self.assertNotEquals(options.chrome_root, None)
Ejemplo n.º 27
0
 def testBuildBotWithGoodChromeRevAndRootOption(self):
   """chrome_rev can get reset around chrome_root."""
   args = ['--local',
       '--buildroot=/tmp',
       '--chrome_rev=%s' % constants.CHROME_REV_LATEST,
       '--chrome_rev=%s' % constants.CHROME_REV_STICKY,
       '--chrome_rev=%s' % constants.CHROME_REV_TOT,
       '--chrome_rev=%s' % constants.CHROME_REV_TOT,
       '--chrome_rev=%s' % constants.CHROME_REV_STICKY,
       '--chrome_rev=%s' % constants.CHROME_REV_LATEST,
       '--chrome_rev=%s' % constants.CHROME_REV_LOCAL,
       '--chrome_root=.',
       '--chrome_rev=%s' % constants.CHROME_REV_TOT,
       '--chrome_rev=%s' % constants.CHROME_REV_LOCAL,
       self._X86_PREFLIGHT]
   self.mox.ReplayAll()
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.mox.VerifyAll()
   self.assertEquals(options.chrome_rev, constants.CHROME_REV_LOCAL)
   self.assertNotEquals(options.chrome_root, None)
Ejemplo n.º 28
0
 def testBuildBotWithoutProfileOption(self):
   """Test that no --profile option gets defaulted."""
   args = ['--buildbot', self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.profile, None)
Ejemplo n.º 29
0
 def testBuildbotDebugWithPatches(self):
   """Test we can test patches with --buildbot --debug."""
   args = ['--remote', '-g', '1234', '--debug', '--buildbot',
           self._X86_PREFLIGHT]
   cbuildbot._ParseCommandLine(self.parser, args)
Ejemplo n.º 30
0
 def testBuildBotOption(self):
     """Test that --buildbot option unsets debug flag."""
     args = ['-r', self._BUILD_ROOT, '--buildbot', self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertFalse(options.debug)
     self.assertTrue(options.buildbot)
Ejemplo n.º 31
0
 def testBuildBotWithoutProfileOption(self):
     """Test that no --profile option gets defaulted."""
     args = ['--buildbot', self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.profile, None)
Ejemplo n.º 32
0
 def testBuildBotOption(self):
   """Test that --buildbot option unsets debug flag."""
   args = ['-r', self._BUILD_ROOT, '--buildbot', self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.debug, False)
   self.assertEquals(options.buildbot, True)
Ejemplo n.º 33
0
    def testPassThroughOptions(self):
        """Test we are building up pass-through list properly."""
        args = ['--remote', '-g', '1234', self._X86_PREFLIGHT]
        options, args = cbuildbot._ParseCommandLine(self.parser, args)

        self.assertEquals(options.pass_through_args, ['-g', '1234'])
Ejemplo n.º 34
0
 def testBuildBotWithDebugOption(self):
     """Test that --debug option overrides --buildbot option."""
     args = ["-r", self._BUILD_ROOT, "--buildbot", "--debug", self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertTrue(options.debug)
     self.assertTrue(options.buildbot)
Ejemplo n.º 35
0
 def testDebugPassThrough(self):
   """Test we are passing --debug through."""
   args = ['--remote', '--debug', '--buildbot', self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.pass_through_args, ['--debug', '--buildbot'])
Ejemplo n.º 36
0
 def testBuildBotWithProfileOption(self):
   """Test that --profile option gets parsed."""
   args = ['--buildbot', '--profile', 'carp', self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.profile, 'carp')
Ejemplo n.º 37
0
 def testBuildBotWithGoodChromeRootOption(self):
     """chrome_root can be set without chrome_rev."""
     args = ["--local", "--buildroot=/tmp", "--chrome_root=.", self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.chrome_rev, constants.CHROME_REV_LOCAL)
     self.assertNotEquals(options.chrome_root, None)
Ejemplo n.º 38
0
 def testBuildBotWithProfileOption(self):
     """Test that --profile option gets parsed."""
     args = ["--buildbot", "--profile", "carp", self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.profile, "carp")
Ejemplo n.º 39
0
 def testBuildbotDebugWithPatches(self):
     """Test we can test patches with --buildbot --debug."""
     args = ["--remote", "-g", "1234", "--debug", "--buildbot", self._X86_PREFLIGHT]
     cbuildbot._ParseCommandLine(self.parser, args)
Ejemplo n.º 40
0
 def testLocalTrybotWithSpacesInPatches(self):
     """Test that we handle spaces in patch arguments."""
     args = ["-r", self._BUILD_ROOT, "--remote", "--local-patches", " proj:br \t  proj2:b2 ", self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.local_patches, ["proj:br", "proj2:b2"])
Ejemplo n.º 41
0
    def testPassThroughOptions(self):
        """Test we are building up pass-through list properly."""
        args = ["--remote", "-g", "1234", self._X86_PREFLIGHT]
        options, args = cbuildbot._ParseCommandLine(self.parser, args)

        self.assertEquals(options.pass_through_args, ["-g", "1234"])
Ejemplo n.º 42
0
 def testCreateBranchDelete(self):
     """Test we don't require --version with --delete."""
     args = ["--delete-branch", "--branch-name", "refs/heads/test", constants.BRANCH_UTIL_CONFIG]
     cbuildbot._ParseCommandLine(self.parser, args)
Ejemplo n.º 43
0
  def testPassThroughOptions(self):
    """Test we are building up pass-through list properly."""
    args = ['--remote', '-g', '1234', self._X86_PREFLIGHT]
    (options, args) = cbuildbot._ParseCommandLine(self.parser, args)

    self.assertEquals(options.pass_through_args, ['-g', '1234'])
Ejemplo n.º 44
0
 def testBuildBotWithProfileOption(self):
     """Test that --profile option gets parsed."""
     args = ['--buildbot', '--profile', 'carp', self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.profile, 'carp')
Ejemplo n.º 45
0
 def testDebugBuildBotSetByDefault(self):
     """Test that debug and buildbot flags are set by default."""
     args = ['--local', '-r', self._BUILD_ROOT, self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertTrue(options.debug)
     self.assertFalse(options.buildbot)
Ejemplo n.º 46
0
 def testDebugBuildBotSetByDefault(self):
   """Test that debug and buildbot flags are set by default."""
   args = ['--local', '-r', self._BUILD_ROOT, self._X86_PREFLIGHT]
   (options, args) = cbuildbot._ParseCommandLine(self.parser, args)
   self.assertEquals(options.debug, True)
   self.assertEquals(options.buildbot, False)
Ejemplo n.º 47
0
 def testBuildBotOption(self):
     """Test that --buildbot option unsets debug flag."""
     args = ["-r", self._BUILD_ROOT, "--buildbot", self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertFalse(options.debug)
     self.assertTrue(options.buildbot)
Ejemplo n.º 48
0
 def testDebugPassThrough(self):
     """Test we are passing --debug through."""
     args = ['--remote', '--debug', '--buildbot', self._X86_PREFLIGHT]
     options, args = cbuildbot._ParseCommandLine(self.parser, args)
     self.assertEquals(options.pass_through_args, ['--debug', '--buildbot'])