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

Unified Diff: dashboard/dashboard/pinpoint/handlers/new.py

Issue 3010873003: [pinpoint] Limit executions to one test run each + device sharding. (Closed)
Patch Set: Ready! Created 3 years, 3 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: dashboard/dashboard/pinpoint/handlers/new.py
diff --git a/dashboard/dashboard/pinpoint/handlers/new.py b/dashboard/dashboard/pinpoint/handlers/new.py
index 4fd6de554c7249f86874fd034b1bf5034f776e79..449bf6528e30e753ee613d63ffca53a7f548039e 100644
--- a/dashboard/dashboard/pinpoint/handlers/new.py
+++ b/dashboard/dashboard/pinpoint/handlers/new.py
@@ -29,6 +29,7 @@ class New(webapp2.RequestHandler):
@api_auth.Authorize
def _CreateJob(self):
"""Start a new Pinpoint job."""
+ repeat_count = self.request.get('repeat_count')
auto_explore = self.request.get('auto_explore') == '1'
bug_id = self.request.get('bug_id')
@@ -48,6 +49,7 @@ class New(webapp2.RequestHandler):
# Validate arguments and convert them to canonical internal representation.
arguments, quests = quest_generator.GenerateQuests(self.request)
+ repeat_count = _ValidateRepeatCount(repeat_count)
bug_id = _ValidateBugId(bug_id)
changes = _ValidateChanges(change_1, change_2)
@@ -56,6 +58,7 @@ class New(webapp2.RequestHandler):
arguments=arguments,
quests=quests,
auto_explore=auto_explore,
+ repeat_count=repeat_count,
bug_id=bug_id)
# Add changes.
@@ -77,6 +80,16 @@ class New(webapp2.RequestHandler):
}))
+def _ValidateRepeatCount(repeat_count):
+ if not repeat_count:
+ return None
+
+ try:
+ return int(repeat_count)
+ except ValueError:
+ raise ValueError('"repeat_count" must be an integer.')
+
+
def _ValidateBugId(bug_id):
if not bug_id:
return None

Powered by Google App Engine
This is Rietveld 408576698