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

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: Created 6 years 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
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..ca53a882748aa3f1ea51c446a16267e28402030c 100644
--- a/tools/telemetry/telemetry/page/profile_generator.py
+++ b/tools/telemetry/telemetry/page/profile_generator.py
@@ -68,20 +68,16 @@ def _IsPseudoFile(directory, paths):
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)))
+ profile_creator_instance = profile_creator_class()
+ try:
+ profile_creator_instance.Run(options)
+ except Exception:
+ logging.exception('Profile creation failed.')
+ shutil.rmtree(temp_output_directory)
return 1
dtu 2015/01/09 01:23:58 I prefer re-raising the exception here, so we get
erikchen 2015/01/09 03:12:42 Sounds reasonable to me. Done. I re-raised the exc
# Everything is a-ok, move results to final destination.

Powered by Google App Engine
This is Rietveld 408576698