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

Unified Diff: infra_libs/ts_mon/common/test/metrics_test.py

Issue 1720323002: Update metrics.proto, and set metric descriptions in MetricsData messages (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Undo the go link change Created 4 years, 10 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
Index: infra_libs/ts_mon/common/test/metrics_test.py
diff --git a/infra_libs/ts_mon/common/test/metrics_test.py b/infra_libs/ts_mon/common/test/metrics_test.py
index 3e2a630a272919b0d444519471aa966c912b2a44..a27833b1fe680b347e792d1a40b5e03174ec780c 100644
--- a/infra_libs/ts_mon/common/test/metrics_test.py
+++ b/infra_libs/ts_mon/common/test/metrics_test.py
@@ -53,6 +53,14 @@ class MetricTest(TestBase):
m.serialize_to(p, 1234, (('bar', 1), ('baz', False)), m.get(), t)
return str(p).splitlines()
+ def test_serialize_with_description(self):
+ t = targets.DeviceTarget('reg', 'role', 'net', 'host')
+ m = metrics.StringMetric('test', description='a custom description')
+ m.set('val')
+ p = metrics_pb2.MetricsCollection()
+ m.serialize_to(p, 1234, (('bar', 1), ('baz', False)), m.get(), t)
+ return str(p).splitlines()
+
def test_serialize_too_many_fields(self):
m = metrics.StringMetric('test', fields={'a': 1, 'b': 2, 'c': 3, 'd': 4})
m.set('val', fields={'e': 5, 'f': 6, 'g': 7})

Powered by Google App Engine
This is Rietveld 408576698