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

Unified Diff: tools/perf/core/telemetry_dependencies_unittest.py

Issue 1467143006: [Telemetry] Migrate find_dependencies internals to tools/perf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Ned's comment Created 5 years, 1 month 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 | « tools/perf/core/find_dependencies_unittest.py ('k') | tools/perf/find_dependencies » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/core/telemetry_dependencies_unittest.py
diff --git a/tools/telemetry/telemetry/telemetry_dependencies_unittest.py b/tools/perf/core/telemetry_dependencies_unittest.py
similarity index 70%
rename from tools/telemetry/telemetry/telemetry_dependencies_unittest.py
rename to tools/perf/core/telemetry_dependencies_unittest.py
index b61684e3ddaf1cd841184cb60cf202737e6715da..20c07750bf8dc18a8cdab4736fb17b6667343048 100644
--- a/tools/telemetry/telemetry/telemetry_dependencies_unittest.py
+++ b/tools/perf/core/telemetry_dependencies_unittest.py
@@ -2,18 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import json
+# TODO(eakuefner): Remove this test once Telemetry lives in Catapult.
import os
import platform
import sys
import unittest
-from telemetry.internal.util import find_dependencies
from telemetry.internal.util import path
+from core import find_dependencies
+from core import path_util
-_TELEMETRY_DEPS_PATH = os.path.join(
- path.GetTelemetryDir(), 'telemetry', 'TELEMETRY_DEPS')
+_TELEMETRY_DEPS = [
+ 'build/android/devil/',
+ 'build/android/pylib/',
+ 'third_party/catapult/',
+ 'tools/telemetry/']
def _GetCurrentTelemetryDependencies():
@@ -25,20 +29,13 @@ def _GetCurrentTelemetryDependencies():
def _GetRestrictedTelemetryDeps():
- with open(_TELEMETRY_DEPS_PATH, 'r') as f:
- telemetry_deps = json.load(f)
-
# Normalize paths in telemetry_deps since TELEMETRY_DEPS file only contain
# the relative path in chromium/src/.
def NormalizePath(p):
p = p.replace('/', os.path.sep)
- return os.path.realpath(os.path.join(path.GetChromiumSrcDir(), p))
+ return os.path.realpath(os.path.join(path_util.GetChromiumSrcDir(), p))
- telemetry_deps['file_deps'] = [
- NormalizePath(p) for p in telemetry_deps['file_deps']]
- telemetry_deps['directory_deps'] = [
- NormalizePath(p) for p in telemetry_deps['directory_deps']]
- return telemetry_deps
+ return map(NormalizePath, _TELEMETRY_DEPS)
class TelemetryDependenciesTest(unittest.TestCase):
@@ -48,9 +45,7 @@ class TelemetryDependenciesTest(unittest.TestCase):
current_dependencies = _GetCurrentTelemetryDependencies()
extra_dep_paths = []
for dep_path in current_dependencies:
- if not (dep_path in telemetry_deps['file_deps'] or
- any(path.IsSubpath(dep_path, d)
- for d in telemetry_deps['directory_deps'])):
+ if not any(path.IsSubpath(dep_path, d) for d in telemetry_deps):
extra_dep_paths.append(dep_path)
# Temporarily ignore failure on Mac because test is failing on Mac 10.8 bot.
# crbug.com/522335
« no previous file with comments | « tools/perf/core/find_dependencies_unittest.py ('k') | tools/perf/find_dependencies » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698