Commit 1330aa2c by Lubosz Sarnecki Committed by Commit Bot

capture_replay_tests: Fix repository path retrieval.

Use relation to retrieve angle repository path. The previous way of detecting the root repository folder failed to detect a correct path if the angle directory was in a path that contained the string angle. e.g. `/home/user/code/angle/angle` Other paths that would fail with the current implementation: `/home/user/my-angle-workspace/angle` `/home/tangled/workspace/angle/` `/home/user/code/angle-android` This way the path is constructed with the known relation of the script path inside the repository. Another advantage of this way is that the `angle` repository could be checked out with a different name. The disadvantage of this method is that whenever the script was moved, the relative path must be updated. Bug: angleproject:5645 Change-Id: I9a56aeba449b248273087382adceb0d6fba5a494 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2715323Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 37752956
...@@ -768,9 +768,7 @@ def ClearFolderContent(path): ...@@ -768,9 +768,7 @@ def ClearFolderContent(path):
os.remove(os.path.join(path, f)) os.remove(os.path.join(path, f))
def SetCWDToAngleFolder(): def SetCWDToAngleFolder():
angle_folder = "angle" cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
cwd = os.path.dirname(os.path.abspath(__file__))
cwd = cwd.split(angle_folder)[0] + angle_folder
os.chdir(cwd) os.chdir(cwd)
return cwd return cwd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment