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

Unified Diff: tracing/PRESUBMIT.py

Issue 2914163002: Check that Diagnostic subclasses are registered in presubmit. (Closed)
Patch Set: comments Created 3 years, 7 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 | « no previous file | tracing/bin/validate_all_diagnostics » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/PRESUBMIT.py
diff --git a/tracing/PRESUBMIT.py b/tracing/PRESUBMIT.py
index 32f06c0831b4c26d43c760f1e21991d464f272a2..164b67fcc2390bcf871dd73206e7c398d7918bb8 100644
--- a/tracing/PRESUBMIT.py
+++ b/tracing/PRESUBMIT.py
@@ -25,6 +25,21 @@ def _CheckRegisteredMetrics(input_api, output_api):
return results
+def _CheckRegisteredDiagnostics(input_api, output_api):
+ """Check that all Diagnostic subclasses are registered."""
+ results = []
+ tracing_dir = input_api.PresubmitLocalPath()
+ out, return_code = _RunArgs(
+ [input_api.python_executable,
+ input_api.os_path.join(tracing_dir, 'bin', 'validate_all_diagnostics')],
+ input_api)
+ if return_code:
+ results.append(output_api.PresubmitError(
+ 'Failed validate_all_diagnostics: ', long_text=out))
+ return results
+
+
+
def CheckChangeOnUpload(input_api, output_api):
return _CheckChange(input_api, output_api)
@@ -51,6 +66,7 @@ def _CheckChange(input_api, output_api):
pylintrc='../pylintrc'))
results += _CheckRegisteredMetrics(input_api, output_api)
+ results += _CheckRegisteredDiagnostics(input_api, output_api)
return results
« no previous file with comments | « no previous file | tracing/bin/validate_all_diagnostics » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698