Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Unified Diff: buildbot/cbuildbot_commands_unittest.py

Issue 6840064: Restart codereview issue 6792042 (Closed) Base URL: http://git.chromium.org/git/chromite.git@master
Patch Set: Fix exec failures and other meta command failures to regular command failures. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: buildbot/cbuildbot_commands_unittest.py
diff --git a/buildbot/cbuildbot_commands_unittest.py b/buildbot/cbuildbot_commands_unittest.py
index 099f6308e7a1c25d041cd7689ec3ac975f15ca91..6ec5ebc9a9121273282f83dbe3f5fda44ce0fa97 100755
--- a/buildbot/cbuildbot_commands_unittest.py
+++ b/buildbot/cbuildbot_commands_unittest.py
@@ -24,6 +24,7 @@ class CBuildBotTest(mox.MoxTestBase):
mox.MoxTestBase.setUp(self)
# Always stub RunCommmand out as we use it in every method.
self.mox.StubOutWithMock(cros_lib, 'OldRunCommand')
+ self.mox.StubOutWithMock(cros_lib, 'RunCommand')
self.tracking_branch = 'cros/master'
self._test_repos = [['kernel', 'third_party/kernel/files'],
['login_manager', 'platform/login_manager']
@@ -157,6 +158,37 @@ class CBuildBotTest(mox.MoxTestBase):
commands._RepoSync(self._buildroot, retries=2)
self.mox.VerifyAll()
+ def testBuildIncremental(self):
+ """Base case where Build is called."""
+ buildroot = '/bob/'
+ cros_lib.RunCommand(mox.IgnoreArg(), cwd=mox.StrContains(buildroot),
+ enter_chroot=True, extra_env=mox.IgnoreArg())
+ self.mox.ReplayAll()
+ commands.Build(buildroot, False)
+ self.mox.VerifyAll()
+
+ def testBuildClobber(self):
+ """Base case where Build with emptytree is called."""
+ buildroot = '/bob/'
+ cros_lib.RunCommand(mox.IgnoreArg(), cwd=mox.StrContains(buildroot),
+ enter_chroot=True,
+ extra_env=mox.ContainsKeyValue('EXTRA_BOARD_FLAGS','--emptytree'))
+ self.mox.ReplayAll()
+ commands.Build(buildroot, True)
+ self.mox.VerifyAll()
+
+ def testBuildWithEnv(self):
+ """Case where Build is called with a custom environment."""
+ buildroot = '/bob/'
+ extra = {'A' :'Av', 'B' : 'Bv'}
+ cros_lib.RunCommand( mox.IgnoreArg(), cwd=mox.StrContains(buildroot),
+ enter_chroot=True,extra_env=mox.And(
+ mox.ContainsKeyValue('A','Av'), mox.ContainsKeyValue('B','Bv')))
+ self.mox.ReplayAll()
+ commands.Build(buildroot, True, extra_env=extra)
+ self.mox.VerifyAll()
+
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698