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

Unified Diff: dashboard/dashboard/add_histograms_queue_test.py

Issue 2879453002: [Dashboard] Get or create ancestors in add_histograms_queue (Closed)
Patch Set: actually add new add_point_queue 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_histograms_queue.py ('k') | dashboard/dashboard/add_point_queue.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/add_histograms_queue_test.py
diff --git a/dashboard/dashboard/add_histograms_queue_test.py b/dashboard/dashboard/add_histograms_queue_test.py
index 0ae53c395e7e4ccafaac1ee7720020909f8af931..0794a83ac8bf236eb80a22786a0ca804bc9b2087 100644
--- a/dashboard/dashboard/add_histograms_queue_test.py
+++ b/dashboard/dashboard/add_histograms_queue_test.py
@@ -6,9 +6,13 @@ import json
import webapp2
import webtest
+from google.appengine.ext import ndb
+
from dashboard import add_histograms_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 histogram
@@ -17,7 +21,7 @@ TEST_HISTOGRAM = json.dumps({
'guid': 'a5dd1360-fed5-4872-9f0e-c1c079b2ae26',
'binBoundaries': [1, [1, 1000, 20]],
'name': 'foo',
- 'unit': 'count'
+ 'unit': 'count_biggerIsBetter'
})
@@ -37,11 +41,24 @@ class AddHistogramsQueueTest(testing_common.TestCase):
'test_path': test_path,
'revision': 123
}
- test_key = utils.TestKey(test_path)
self.testapp.post('/add_histograms_queue', params)
+ test_key = utils.TestKey(test_path)
original_histogram = json.loads(TEST_HISTOGRAM)
+ test = test_key.get()
+ self.assertEqual(test.units, 'count_biggerIsBetter')
sh 2017/05/19 19:10:27 Tests for the different units cases?
eakuefner 2017/05/22 21:22:28 Added test coverage for GetUnitArgs directly.
+ self.assertEqual(test.improvement_direction, anomaly.UP)
+
+ master = ndb.Key('Master', 'Chromium').get()
+ self.assertIsNotNone(master)
+
+ bot = ndb.Key('Master', 'Chromium', 'Bot', 'win7').get()
+ self.assertIsNotNone(bot)
+
+ tests = graph_data.TestMetadata.query().fetch()
+ self.assertEqual(2, len(tests))
+
histograms = histogram.Histogram.query().fetch()
self.assertEqual(1, len(histograms))
self.assertEqual(original_histogram['guid'], histograms[0].key.id())
« no previous file with comments | « dashboard/dashboard/add_histograms_queue.py ('k') | dashboard/dashboard/add_point_queue.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698