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

Unified Diff: tools/telemetry/telemetry/page/profile_generator.py

Issue 825703003: Change profile_creator to not subclass page_test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@telemetry_profile_generation
Patch Set: Rebase against top of tree. Created 5 years, 11 months 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/telemetry/telemetry/page/profile_creator.py ('k') | tools/telemetry/telemetry/page/record_wpr.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/profile_generator.py
diff --git a/tools/telemetry/telemetry/page/profile_generator.py b/tools/telemetry/telemetry/page/profile_generator.py
index 7491345849b1183b6b5d7430b74f9679e830f4e7..4d7bf7d75d2cf385c747a59309e3c57ec7eb71ea 100644
--- a/tools/telemetry/telemetry/page/profile_generator.py
+++ b/tools/telemetry/telemetry/page/profile_generator.py
@@ -66,23 +66,20 @@ def _IsPseudoFile(directory, paths):
return ignore_list
+
def GenerateProfiles(profile_creator_class, profile_creator_name, options):
"""Generate a profile"""
- expectations = test_expectations.TestExpectations()
- test = profile_creator_class()
temp_output_directory = tempfile.mkdtemp()
options.output_profile_path = temp_output_directory
- results = results_options.CreateResults(
- benchmark.BenchmarkMetadata(test.__class__.__name__), options)
- user_story_runner.Run(test, test.page_set, expectations, options, results)
-
- if results.failures:
- logging.warning('Some pages failed.')
- logging.warning('Failed pages:\n%s',
- '\n'.join(map(str, results.pages_that_failed)))
- return 1
+ profile_creator_instance = profile_creator_class()
+ try:
+ profile_creator_instance.Run(options)
+ except Exception as e:
+ logging.exception('Profile creation failed.')
+ shutil.rmtree(temp_output_directory)
+ raise e
# Everything is a-ok, move results to final destination.
generated_profiles_dir = os.path.abspath(options.output_dir)
« no previous file with comments | « tools/telemetry/telemetry/page/profile_creator.py ('k') | tools/telemetry/telemetry/page/record_wpr.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698