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

Unified Diff: dashboard/dashboard/add_point_queue_test.py

Issue 2879453002: [Dashboard] Get or create ancestors in add_histograms_queue (Closed)
Patch Set: fix failing unit add_point test 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 | « dashboard/dashboard/add_point_queue.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/add_point_queue_test.py
diff --git a/dashboard/dashboard/add_point_queue_test.py b/dashboard/dashboard/add_point_queue_test.py
index 9615206496b5387dfe0b0efc53f75b35288e7782..fef23656a53bdd17fa16cb05ce2b9acf6e364239 100644
--- a/dashboard/dashboard/add_point_queue_test.py
+++ b/dashboard/dashboard/add_point_queue_test.py
@@ -7,6 +7,7 @@ import unittest
from dashboard import add_point_queue
from dashboard.common import testing_common
from dashboard.common import utils
+from dashboard.models import anomaly
from dashboard.models import graph_data
from dashboard.models import stoppage_alert
@@ -23,7 +24,7 @@ class GetOrCreateAncestorsTest(testing_common.TestCase):
graph_data.TestMetadata(id='ChromiumPerf/win7/dromaeo',).put()
graph_data.TestMetadata(id='ChromiumPerf/win7/dromaeo/dom').put()
graph_data.TestMetadata(id='ChromiumPerf/win7/dromaeo/dom/modify').put()
- actual_parent = add_point_queue._GetOrCreateAncestors(
+ actual_parent = add_point_queue.GetOrCreateAncestors(
'ChromiumPerf', 'win7', 'dromaeo/dom/modify')
self.assertEqual(
'ChromiumPerf/win7/dromaeo/dom/modify', actual_parent.key.id())
@@ -35,7 +36,7 @@ class GetOrCreateAncestorsTest(testing_common.TestCase):
self.assertEqual(3, len(graph_data.TestMetadata.query().fetch()))
def testGetOrCreateAncestors_CreatesAllExpectedEntities(self):
- parent = add_point_queue._GetOrCreateAncestors(
+ parent = add_point_queue.GetOrCreateAncestors(
'ChromiumPerf', 'win7', 'dromaeo/dom/modify')
self.assertEqual('ChromiumPerf/win7/dromaeo/dom/modify', parent.key.id())
# Check that all the Bot and TestMetadata entities were correctly added.
@@ -69,11 +70,17 @@ class GetOrCreateAncestorsTest(testing_common.TestCase):
alert_key = stoppage_alert.CreateStoppageAlert(test, row).put()
test.stoppage_alert = alert_key
test.put()
- add_point_queue._GetOrCreateAncestors('M', 'b', 'suite/foo')
+ add_point_queue.GetOrCreateAncestors('M', 'b', 'suite/foo')
self.assertIsNone(test.key.get().stoppage_alert)
self.assertTrue(alert_key.get().recovered)
self.assertIsNotNone(alert_key.get().last_row_timestamp)
+ def testGetOrCreateAncestors_RespectsImprovementDirectionForNewTest(self):
+ test = add_point_queue.GetOrCreateAncestors(
+ 'M', 'b', 'suite/foo', units='bogus',
+ improvement_direction=anomaly.UP)
+ self.assertEqual(anomaly.UP, test.improvement_direction)
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « dashboard/dashboard/add_point_queue.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698