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

Unified Diff: dashboard/dashboard/find_anomalies_test.py

Issue 2627073006: Add a ref_test key to Anomaly entities and surface it in alerts JSON. (Closed)
Patch Set: Address review comments Created 3 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 | « dashboard/dashboard/find_anomalies.py ('k') | dashboard/dashboard/models/anomaly.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/find_anomalies_test.py
diff --git a/dashboard/dashboard/find_anomalies_test.py b/dashboard/dashboard/find_anomalies_test.py
index 53d0def1434ec97b3b88750e75c8a4fdb954ebb6..921c336aa368c04fe6e749483ac1fdef6926fb48 100644
--- a/dashboard/dashboard/find_anomalies_test.py
+++ b/dashboard/dashboard/find_anomalies_test.py
@@ -370,6 +370,67 @@ class ProcessAlertsTest(testing_common.TestCase):
]
mock_logging_error.assert_has_calls(calls, any_order=True)
+ def testMakeAnomalyEntity_NoRefBuild(self):
+ testing_common.AddTests(
+ ['ChromiumPerf'],
+ ['linux'], {
+ 'page_cycler_v2': {
+ 'cnn': {},
+ 'yahoo': {},
+ 'nytimes': {},
+ },
+ })
+ test = utils.TestKey('ChromiumPerf/linux/page_cycler_v2').get()
+ testing_common.AddRows(test.test_path, [100, 200, 300, 400])
+
+ alert = find_anomalies._MakeAnomalyEntity(
+ _MakeSampleChangePoint(10011, 50, 100),
+ test,
+ list(graph_data.Row.query()))
+ self.assertIsNone(alert.ref_test)
+
+ def testMakeAnomalyEntity_RefBuildSlash(self):
+ testing_common.AddTests(
+ ['ChromiumPerf'],
+ ['linux'], {
+ 'page_cycler_v2': {
+ 'ref': {},
+ 'cnn': {},
+ 'yahoo': {},
+ 'nytimes': {},
+ },
+ })
+ test = utils.TestKey('ChromiumPerf/linux/page_cycler_v2').get()
+ testing_common.AddRows(test.test_path, [100, 200, 300, 400])
+
+ alert = find_anomalies._MakeAnomalyEntity(
+ _MakeSampleChangePoint(10011, 50, 100),
+ test,
+ list(graph_data.Row.query()))
+ self.assertEqual(alert.ref_test.string_id(),
+ 'ChromiumPerf/linux/page_cycler_v2/ref')
+
+ def testMakeAnomalyEntity_RefBuildUnderscore(self):
+ testing_common.AddTests(
+ ['ChromiumPerf'],
+ ['linux'], {
+ 'page_cycler_v2': {
+ 'cnn': {},
+ 'cnn_ref': {},
+ 'yahoo': {},
+ 'nytimes': {},
+ },
+ })
+ test = utils.TestKey('ChromiumPerf/linux/page_cycler_v2/cnn').get()
+ testing_common.AddRows(test.test_path, [100, 200, 300, 400])
+
+ alert = find_anomalies._MakeAnomalyEntity(
+ _MakeSampleChangePoint(10011, 50, 100),
+ test,
+ list(graph_data.Row.query()))
+ self.assertEqual(alert.ref_test.string_id(),
+ 'ChromiumPerf/linux/page_cycler_v2/cnn_ref')
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « dashboard/dashboard/find_anomalies.py ('k') | dashboard/dashboard/models/anomaly.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698