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

Unified Diff: client/tests/run_isolated_test.py

Issue 2928153002: Return named output files if they're symlinks (Closed)
Patch Set: Fixed import order Created 3 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 | « client/run_isolated.py ('k') | 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 d34e8aafaaff16a5ee25f0c708f05f87f7ef1ce5..a0e90a07223b4087a70aba7e642017ed545a531e 100755
--- a/client/tests/run_isolated_test.py
+++ b/client/tests/run_isolated_test.py
@@ -775,10 +775,20 @@ class RunIsolatedTestOutputFiles(RunIsolatedTestBase):
# back after the task completed.
server = isolateserver_mock.MockIsolateServer()
try:
+ # Output two files. If we're on Linux, we'll try to make one of them a
+ # symlink to ensure that we correctly follow symlinks. Note that this only
+ # tests file symlinks, not directory symlinks.
+ # TODO(aludwin): follow directory symlinks
script = (
+ 'import os\n'
'import sys\n'
'open(sys.argv[1], "w").write("bar")\n'
- 'open(sys.argv[2], "w").write("baz")\n')
+ 'if sys.platform.startswith("linux"):\n'
+ ' realpath = os.path.abspath("contents_of_symlink")\n'
+ ' open(realpath, "w").write("baz")\n'
+ ' os.symlink(realpath, sys.argv[2])\n'
+ 'else:\n'
+ ' open(sys.argv[2], "w").write("baz")\n')
script_hash = isolateserver_mock.hash_content(script)
isolated['files']['cmd.py'] = {
'h': script_hash,
« no previous file with comments | « client/run_isolated.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698