Commit 24625c0b authored by nednguyen's avatar nednguyen Committed by Commit Bot

Fix breakage bugs in fetch_benchmark_deps.py

1) Fix the typo of referencing a benchmark
2) Create a dummy option object for benchmark 
to instantiate story_set (multitab benchmark CreateStorySet(..) need the option)

TBR=eyaich@chromium.org

Change-Id: I5dce266b64a274d48862e1bcd8305b4a078ce6d8
Reviewed-on: https://chromium-review.googlesource.com/568283
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#486013}
parent 276eacb1
......@@ -6,6 +6,7 @@
"""This module fetches and prints the dependencies given a benchmark."""
import argparse
import optparse
import os
import sys
......@@ -23,6 +24,9 @@ from chrome_telemetry_build import chromium_config
def _FetchDependenciesIfNeeded(story_set):
""" Download files needed by a user story set. """
if not story_set.wpr_archive_info:
return
# Download files in serving_dirs.
serving_dirs = story_set.serving_dirs
for directory in serving_dirs:
......@@ -60,9 +64,14 @@ def _EnumerateDependencies(story_set):
def FetchDepsForBenchmark(benchmark, output):
# Download files according to specified benchmark.
story_set = benchmark().CreateStorySet(None)
# Create a dummy options object which hold default values that are expected
# by Benchmark.CreateStorySet(options) method.
parser = optparse.OptionParser()
benchmark.AddBenchmarkCommandLineArgs(parser)
options, _ = parser.parse_args([])
story_set = benchmark().CreateStorySet(options)
# Download files according to specified benchmark.
_FetchDependenciesIfNeeded(story_set)
# Print files downloaded.
......@@ -96,9 +105,8 @@ def main(args, output):
raw_input(
'No benchmark name is specified. Fetching all benchmark deps. '
'Press enter to continue...')
for b in benchmark_finders.GetAllBenchmarks():
print >> output, ('Fetch dependencies for benchmark %s:'
% benchmark.Name())
for b in benchmark_finders.GetAllPerfBenchmarks():
print >> output, ('Fetch dependencies for benchmark %s' % b.Name())
FetchDepsForBenchmark(b, output)
if __name__ == '__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