Commit b26ed69c authored by nednguyen's avatar nednguyen Committed by Commit bot

[tools/perf] Update code to reference py_utils.cloud_storage

BUG=See https://github.com/catapult-project/catapult/issues/2738
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2300653002
Cr-Commit-Position: refs/heads/master@{#415805}
parent 29276a7a
......@@ -20,7 +20,7 @@ def CommonChecks(input_api, output_api):
output_api,
pylintrc='pylintrc',
extra_paths_list=[
J('third_party', 'catapult', 'catapult_base'),
J('third_party', 'catapult', 'common', 'py_utils'),
J('third_party', 'catapult', 'telemetry'),
J('tools', 'perf'),
])
......
......@@ -6,7 +6,7 @@ import os
from telemetry.testing import serially_executed_browser_test_case
from catapult_base import cloud_storage
from py_utils import cloud_storage
_WPR_ARCHIVE_PATH = os.path.join(os.path.dirname(__file__),
'popular_urls_000.wpr')
......
......@@ -19,7 +19,7 @@ def _GetPathsToPrepend(input_api):
input_api.os_path.join(chromium_src_dir,
'third_party', 'catapult', 'telemetry'),
input_api.os_path.join(chromium_src_dir,
'third_party', 'catapult', 'catapult_base'),
'third_party', 'catapult', 'common', 'py_utils'),
]
def _GpuUnittestsArePassingCheck(input_api, output_api):
......
......@@ -10,7 +10,7 @@ import os
import re
import tempfile
from catapult_base import cloud_storage
from py_utils import cloud_storage
from telemetry.page import page_test
from telemetry.util import image_util
from telemetry.util import rgba_color
......
......@@ -34,7 +34,7 @@ def SetupTelemetryPaths():
if telemetry_path not in sys.path:
sys.path.append(telemetry_path)
catapult_base_path = os.path.join(
chromium_src_dir, 'third_party', 'catapult', 'catapult_base')
if catapult_base_path not in sys.path:
sys.path.append(catapult_base_path)
py_utils_path = os.path.join(
chromium_src_dir, 'third_party', 'catapult', 'common', 'py_utils')
if py_utils_path not in sys.path:
sys.path.append(py_utils_path)
......@@ -10,7 +10,7 @@ from gpu_tests import cloud_storage_test_base
from gpu_tests import pixel_expectations
import page_sets
from catapult_base import cloud_storage
from py_utils import cloud_storage
from telemetry.page import page_test
from telemetry.util import image_util
......
......@@ -21,11 +21,11 @@ def _CheckWprShaFiles(input_api, output_api):
"""Check whether the wpr sha files have matching URLs."""
old_sys_path = sys.path
try:
catapult_base_path = input_api.os_path.join(
_GetChromiumSrcDir(input_api), 'third_party', 'catapult',
'catapult_base')
sys.path.insert(1, catapult_base_path)
from catapult_base import cloud_storage # pylint: disable=import-error
py_utils_path = input_api.os_path.join(
_GetChromiumSrcDir(input_api), 'third_party', 'catapult', 'common',
'py_utils')
sys.path.insert(1, py_utils_path)
from py_utils import cloud_storage # pylint: disable=import-error
finally:
sys.path = old_sys_path
......
......@@ -22,12 +22,12 @@ import shutil
import sys
import zipfile
_CATAPULT_BASE_PATH = os.path.abspath(os.path.join(
_PY_UTILS_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', 'third_party', 'catapult',
'catapult_base'))
if _CATAPULT_BASE_PATH not in sys.path:
sys.path.insert(1, _CATAPULT_BASE_PATH)
from catapult_base import cloud_storage
'common', 'py_utils'))
if _PY_UTILS_PATH not in sys.path:
sys.path.insert(1, _PY_UTILS_PATH)
from py_utils import cloud_storage
import bisect_utils
......
......@@ -44,10 +44,10 @@ def _CheckWprShaFiles(input_api, output_api):
old_sys_path = sys.path
try:
perf_dir = input_api.PresubmitLocalPath()
catapult_path = os.path.abspath(os.path.join(
perf_dir, '..', '..', 'third_party', 'catapult', 'catapult_base'))
sys.path.insert(1, catapult_path)
from catapult_base import cloud_storage # pylint: disable=import-error
py_utils_path = os.path.abspath(os.path.join(
perf_dir, '..', '..', 'third_party', 'catapult', 'common', 'py_utils'))
sys.path.insert(1, py_utils_path)
from py_utils import cloud_storage # pylint: disable=import-error
finally:
sys.path = old_sys_path
......
......@@ -14,10 +14,6 @@ def GetChromiumSrcDir():
return chromium_config.GetChromiumSrcDir()
def GetCatapultBaseDir():
return os.path.join(
GetChromiumSrcDir(), 'third_party', 'catapult', 'catapult_base')
def GetTelemetryDir():
return chromium_config.GetTelemetryDir()
......@@ -41,7 +37,8 @@ def AddTelemetryToPath():
sys.path.insert(1, telemetry_path)
def AddCatapultBaseToPath():
catapult_base_path = GetCatapultBaseDir()
if catapult_base_path not in sys.path:
sys.path.insert(1, catapult_base_path)
def AddPyUtilsToPath():
py_utils_dir = os.path.join(
GetChromiumSrcDir(), 'third_party', 'catapult', 'common', 'py_utils')
if py_utils_dir not in sys.path:
sys.path.insert(1, py_utils_dir)
......@@ -10,8 +10,8 @@ import sys
from core import path_util
path_util.AddCatapultBaseToPath()
from catapult_base import cloud_storage
path_util.AddPyUtilsToPath()
from py_utils import cloud_storage
path_util.AddTelemetryToPath()
from telemetry import benchmark_runner
......
......@@ -22,7 +22,7 @@ class FetchBenchmarkDepsUnittest(unittest.TestCase):
It assumes the following telemetry APIs always success:
telemetry.wpr.archive_info.WprArchiveInfo.DownloadArchivesIfNeeded
catapult_base.cloud_storage.GetFilesInDirectoryIfChanged
py_utils.cloud_storage.GetFilesInDirectoryIfChanged
"""
def setUp(self):
......@@ -46,7 +46,7 @@ class FetchBenchmarkDepsUnittest(unittest.TestCase):
output = StringIO.StringIO()
with mock.patch('telemetry.wpr.archive_info.WprArchiveInfo'
'.DownloadArchivesIfNeeded') as mock_download:
with mock.patch('catapult_base.cloud_storage'
with mock.patch('py_utils.cloud_storage'
'.GetFilesInDirectoryIfChanged') as mock_get:
mock_download.return_value = True
mock_get.GetFilesInDirectoryIfChanged.return_value = True
......
......@@ -8,7 +8,7 @@ import sys
import tempfile
import zipfile
from catapult_base import cloud_storage
from py_utils import cloud_storage
from telemetry.page import shared_page_state
......
......@@ -11,4 +11,4 @@ from core import path_util
path_util.AddTelemetryToPath()
path_util.AddCatapultBaseToPath()
path_util.AddPyUtilsToPath()
......@@ -14,8 +14,8 @@ import zipfile
if sys.platform == 'win32':
import _winreg as winreg # pylint: disable=import-error
from catapult_base import cloud_storage
from profile_creators import profile_extender
from py_utils import cloud_storage
from telemetry.core import exceptions
......
......@@ -18,8 +18,8 @@ sys.path.insert(1, os.path.abspath(os.path.join(
from core import path_util
path_util.AddCatapultBaseToPath()
from catapult_base import cloud_storage
path_util.AddPyUtilsToPath()
from py_utils import cloud_storage
path_util.AddTelemetryToPath()
from telemetry.core import exceptions
......
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