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

Unified Diff: client/tests/run_isolated_test.py

Issue 2078713002: swarming: do not leak cache dirs in tests (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: fix test_main_naked_without_isolated 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/run_isolated_test.py
diff --git a/client/tests/run_isolated_test.py b/client/tests/run_isolated_test.py
index 5bb28c3d427ea417b2c13acd9a82e8bbd7a8cc6b..cbdc939de14e8e9ab55164a7e2fc6f3f86060427 100755
--- a/client/tests/run_isolated_test.py
+++ b/client/tests/run_isolated_test.py
@@ -322,6 +322,7 @@ class RunIsolatedTest(RunIsolatedTestBase):
self.mock_popen_with_oserr()
cmd = [
'--no-log',
+ '--cache', self.tempdir,
'/bin/echo',
'hello',
'world',
@@ -358,10 +359,13 @@ class RunIsolatedTest(RunIsolatedTestBase):
finally:
os.close(packages_fd)
+ cipd_cache = os.path.join(self.tempdir, 'cipd_cache')
cmd = [
'--no-log',
+ '--cache', os.path.join(self.tempdir, 'cache'),
'--cipd-package-list', packages_path,
'--cipd-server', self.cipd_server.url,
+ '--cipd-cache', cipd_cache,
'bin/echo${EXECUTABLE_SUFFIX}',
'hello',
'world',
@@ -375,23 +379,23 @@ class RunIsolatedTest(RunIsolatedTestBase):
# Test cipd-ensure command for installing packages.
for cipd_ensure_cmd, _ in self.popen_calls[0:2]:
self.assertEqual(cipd_ensure_cmd[:2], [
- os.path.abspath('cipd_cache/cipd' + cipd.EXECUTABLE_SUFFIX),
+ os.path.join(cipd_cache, 'cipd' + cipd.EXECUTABLE_SUFFIX),
'ensure',
])
cache_dir_index = cipd_ensure_cmd.index('-cache-dir')
self.assertEqual(
cipd_ensure_cmd[cache_dir_index+1],
- os.path.abspath('cipd_cache/cipd_internal'))
+ os.path.join(cipd_cache, 'cipd_internal'))
# Test cipd cache.
- version_file = unicode(os.path.abspath(
- 'cipd_cache/versions/1481d0a0ceb16ea4672fed76a0710306eb9f3a33'))
+ version_file = unicode(os.path.join(
+ cipd_cache, 'versions', '1481d0a0ceb16ea4672fed76a0710306eb9f3a33'))
self.assertTrue(fs.isfile(version_file))
with open(version_file) as f:
self.assertEqual(f.read(), 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
- client_binary_file = unicode(os.path.abspath(
- 'cipd_cache/clients/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
+ client_binary_file = unicode(os.path.join(
+ cipd_cache, 'clients', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
self.assertTrue(fs.isfile(client_binary_file))
# Test echo call.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698