Commit 54fe57e6 authored by Dan Harrington's avatar Dan Harrington Committed by Commit Bot

add an internal directory to manage_wpr_archives.py

This is in preparation for a test to be added in that
location.

Bug: 1141619
Change-Id: I5731ff84dcc79d81acb3f877ab47c4c6e2acaffa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2493125Reviewed-by: default avatarArthur Wang <wuwang@chromium.org>
Commit-Queue: Arthur Wang <wuwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820867}
parent 6cc0e7a1
[style]
based_on_style = chromium
......@@ -17,11 +17,22 @@ from upload_download_utils import verify_file_exists
STORAGE_BUCKET = 'chrome-wpr-archives'
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
CHROMIUM_SRC = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..', '..'))
WPR_RECORD_REPLAY_TEST_DIRECTORIES = [
os.path.join(
CHROMIUM_SRC, 'chrome', 'android', 'feed', 'core', 'javatests',
'src', 'org', 'chromium', 'chrome', 'browser', 'feed', 'wpr_tests'),
]
def _GetReplayTestDirectories():
directories = [
os.path.join(CHROMIUM_SRC, 'chrome', 'android', 'feed', 'core',
'javatests', 'src', 'org', 'chromium', 'chrome', 'browser',
'feed', 'wpr_tests'),
]
internal_dir = os.path.join(CHROMIUM_SRC, 'clank', 'javatests', 'src', 'org',
'chromium', 'chrome', 'browser', 'wprtests',
'replays')
if os.path.isdir(internal_dir):
directories.append(internal_dir)
return directories
def _is_file_of_interest(f):
......@@ -38,17 +49,17 @@ def main():
args = parser.parse_args()
if args.action == 'download':
for d in WPR_RECORD_REPLAY_TEST_DIRECTORIES:
for d in _GetReplayTestDirectories():
download(d, _is_file_of_interest,
'WPR archives', STORAGE_BUCKET)
if not verify_file_exists(d, _is_file_of_interest):
logging.error('There is not file of interest in dir {}'.format(d))
else:
for d in WPR_RECORD_REPLAY_TEST_DIRECTORIES:
for d in _GetReplayTestDirectories():
upload(d, _is_file_of_interest,
'WPR archives', STORAGE_BUCKET, args.dry_run)
if __name__ == '__main__':
main()
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