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

Unified Diff: client/tests/run_isolated_test.py

Issue 2847153002: Cache/retrieve extracted CIPD packages in local isolate cache (Closed)
Patch Set: Address more comments Created 3 years, 7 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: client/tests/run_isolated_test.py
diff --git a/client/tests/run_isolated_test.py b/client/tests/run_isolated_test.py
index a58e1261721b8387ae6eeadfb469c68b11f4ec52..a24d0cc419e8cd7a6f861f6443fc0146c58f4c6d 100755
--- a/client/tests/run_isolated_test.py
+++ b/client/tests/run_isolated_test.py
@@ -428,7 +428,13 @@ class RunIsolatedTest(RunIsolatedTestBase):
return 0
self.popen_mocks.append(fake_ensure)
+ self._fake_isolated_cache = {}
+ self.mock(cipd.CipdClient, '_ensure_from_isolate',
+ self.fake_ensure_from_isolate)
+ self.mock(cipd.CipdClient, '_isolate_cipd', self.fake_isolate_cipd)
+
cipd_cache = os.path.join(self.tempdir, 'cipd_cache')
+
cmd = [
'--no-log',
'--cache', os.path.join(self.tempdir, 'cache'),
@@ -478,6 +484,16 @@ class RunIsolatedTest(RunIsolatedTestBase):
echo_cmd[0])
self.assertEqual(echo_cmd[1:], ['hello', 'world'])
+ def fake_ensure_from_isolate(self, target_dir, cipd_isolated, isolate_cache):
+ # Not seen first time, then seen all other times
+ if cipd_isolated not in self._fake_isolated_cache:
+ self._fake_isolated_cache[cipd_isolated] = True
+ return False
+ return True
+
+ def fake_isolate_cipd(self, root, pkgs, isolate_cache, cipd_cache):
+ pass
+
def test_main_naked_with_cipd_client_no_packages(self):
cipd_cache = os.path.join(self.tempdir, 'cipd_cache')
cmd = [
« client/run_isolated.py ('K') | « client/run_isolated.py ('k') | client/utils/fs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698