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

Unified Diff: scripts/slave/unittests/annotated_run_test.py

Issue 2062293002: annotated_run: Use builder directory for temp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 6 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
« no previous file with comments | « scripts/slave/annotated_run.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/annotated_run_test.py
diff --git a/scripts/slave/unittests/annotated_run_test.py b/scripts/slave/unittests/annotated_run_test.py
index df8d22f91247e4e4fa713d9d50de9c26b78f7f83..121f0f8d60168d0f4ffa5daf00ee0e3a18d1d573 100755
--- a/scripts/slave/unittests/annotated_run_test.py
+++ b/scripts/slave/unittests/annotated_run_test.py
@@ -81,10 +81,15 @@ class AnnotatedRunExecTest(unittest.TestCase):
self._patchers = []
map(self._patch, (
mock.patch('slave.annotated_run._run_command'),
+ mock.patch('slave.annotated_run._build_dir'),
+ mock.patch('slave.annotated_run._builder_dir'),
mock.patch('os.path.exists'),
- mock.patch('os.getcwd'),
))
+ # Mock build and builder directories.
+ annotated_run._build_dir.return_value = '/home/user/builder/build'
+ annotated_run._builder_dir.return_value = '/home/user/builder'
+
self.rt = robust_tempdir.RobustTempdir(prefix='annotated_run_test')
self.basedir = self.rt.tempdir()
self.tdir = self.rt.tempdir()
@@ -95,16 +100,14 @@ class AnnotatedRunExecTest(unittest.TestCase):
'mastername': 'master.random',
'buildername': 'builder',
}
- self.cwd = os.path.join('home', 'user')
self.rpy_path = os.path.join(env.Build, 'scripts', 'slave', 'recipes.py')
self.recipe_args = [
sys.executable, '-u', self.rpy_path, '--verbose', 'run',
- '--workdir=%s' % (self.cwd,),
+ '--workdir=/home/user/builder/build',
'--properties-file=%s' % (self._tp('recipe_properties.json'),),
'example/recipe']
# Use public recipes.py path.
- os.getcwd.return_value = self.cwd
os.path.exists.return_value = False
def tearDown(self):
« no previous file with comments | « scripts/slave/annotated_run.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698