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

Unified Diff: appengine/swarming/handlers_test.py

Issue 2212073002: Add endpoint and cron job to aggregate all dimensions and values (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: trying things Created 4 years, 4 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: appengine/swarming/handlers_test.py
diff --git a/appengine/swarming/handlers_test.py b/appengine/swarming/handlers_test.py
index 1b02abf1dfa558a05dad5f24e1df44a87d06ab36..3dd06eceb09656e0823d365bbee2dbb46a5a133b 100755
--- a/appengine/swarming/handlers_test.py
+++ b/appengine/swarming/handlers_test.py
@@ -4,6 +4,7 @@
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
+import datetime
import itertools
import json
import logging
@@ -479,6 +480,26 @@ class BackendTest(AppTestBase):
# The actual number doesn't matter, just make sure they are unqueued.
self.execute_tasks()
+
+ def testCronBotsAggregateTask(self):
+ #self.set_as_admin()
+ #self.mock_now(datetime.datetime(2009, 1, 2, 3, 4, 5, 6))
+
+ bot_management.bot_event(
+ event_type='bot_connected', bot_id='id1',
+ external_ip='8.8.4.4', authenticated_as='bot:whitelisted-ip',
+ dimensions={'foo': ['alpha'], 'id': ['id1']}, state={'ram': 65},
+ version='123456789', quarantined=False, task_id=None, task_name=None)
+ bot_management.bot_event(
+ event_type='bot_connected', bot_id='id2',
+ external_ip='8.8.4.4', authenticated_as='bot:whitelisted-ip',
+ dimensions={'foo': ['beta'], 'id': ['id2']}, state={'ram': 65},
+ version='123456789', quarantined=True, task_id='987', task_name=None)
+
+ response = self.app.get('/internal/cron/aggregate_bots_dimensions', headers={'X-AppEngine-Cron': 'true'}, status=200)
+ print response
+
+
def testCronTriggerTask(self):
triggers = (
'/internal/cron/trigger_cleanup_data',

Powered by Google App Engine
This is Rietveld 408576698