TelemetryRunner: Expand the ~ in ~/chrome_root when looking for telemetry
When looking for local telemetry sources, TelemetryRunner looked in the
literal directory "~/chrome_root", without expanding the ~. Call
os.path.expanduser to expand it.
Since that directory will contain chrome sources directly, rather than
under a chrome-src-internal or chrome-src subdirectory, stop appending
those subdirectories as well.
With this change, TelemetryRunner can find and use local telemetry
sources from ~/chrome_root.
BUG=None
TEST=manual
Change-Id: I850f3a558b139090a6fc930468a858c2949da9b1
Reviewed-on: https://chromium-review.googlesource.com/208734
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>
diff --git a/server/cros/telemetry_runner.py b/server/cros/telemetry_runner.py
index 8db4810..2a5cb02 100644
--- a/server/cros/telemetry_runner.py
+++ b/server/cros/telemetry_runner.py
@@ -249,12 +249,12 @@
"""
TELEMETRY_DIR = 'src'
CHROME_LOCAL_SRC = '/var/cache/chromeos-cache/distfiles/target/'
- CHROME_EXTERNAL_SRC = '~/chrome_root/'
+ CHROME_EXTERNAL_SRC = os.path.expanduser('~/chrome_root/')
logging.debug('Setting up telemetry for local testing')
sources_list = ('chrome-src-internal', 'chrome-src')
- dir_list = [os.path.join(CHROME_EXTERNAL_SRC, x) for x in sources_list]
+ dir_list = [CHROME_EXTERNAL_SRC]
dir_list.extend(
[os.path.join(CHROME_LOCAL_SRC, x) for x in sources_list])
if 'CHROME_ROOT' in os.environ: