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

Unified Diff: dashboard/dashboard/pinpoint/models/job.py

Issue 2996473002: [pinpoint] Add QuestGenerator object. (Closed)
Patch Set: Created 3 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: dashboard/dashboard/pinpoint/models/job.py
diff --git a/dashboard/dashboard/pinpoint/models/job.py b/dashboard/dashboard/pinpoint/models/job.py
index 57396d37c8fc263aaec71f7ae13b5ac55c845d4d..596b31b5fff4f075840332fa8a5f7545347213b0 100644
--- a/dashboard/dashboard/pinpoint/models/job.py
+++ b/dashboard/dashboard/pinpoint/models/job.py
@@ -60,8 +60,8 @@ class Job(ndb.Model):
# Request parameters.
configuration = ndb.StringProperty(required=True)
- test_suite = ndb.StringProperty()
- test = ndb.StringProperty()
+ target = ndb.StringProperty()
+ test_config = ndb.PickleProperty()
perezju 2017/08/07 12:06:12 nit: wondering whether this should be called targe
dtu 2017/08/15 17:06:41 `target` has to be "config" object because it need
perezju 2017/08/16 08:15:25 Nice! This turned out pretty neat!
metric = ndb.StringProperty()
# If True, the service should pick additional Changes to run (bisect).
@@ -75,21 +75,16 @@ class Job(ndb.Model):
state = ndb.PickleProperty(required=True)
@classmethod
- def New(cls, configuration, test_suite, test, metric, auto_explore, bug_id):
+ def New(cls, configuration, target, test_config, auto_explore, bug_id):
# Get list of quests.
quests = [quest_module.FindIsolate(configuration)]
- if test_suite:
- quests.append(quest_module.RunTest(configuration, test_suite, test,
- _DEFAULT_REPEAT_COUNT))
- if metric:
- quests.append(quest_module.ReadValue(metric, test))
+ quests += test_config.Quests()
# Create job.
return cls(
configuration=configuration,
- test_suite=test_suite,
- test=test,
- metric=metric,
+ target=target,
+ test_config=test_config,
auto_explore=auto_explore,
bug_id=bug_id,
state=_JobState(quests, _DEFAULT_ATTEMPT_COUNT))
@@ -157,9 +152,8 @@ class Job(ndb.Model):
'job_id': self.job_id,
'configuration': self.configuration,
- 'test_suite': self.test_suite,
- 'test': self.test,
- 'metric': self.metric,
+ 'target': self.target,
+ 'test_config': self.test_config.AsDict(),
'auto_explore': self.auto_explore,
'created': self.created.strftime('%Y-%m-%d %H:%M:%S %Z'),

Powered by Google App Engine
This is Rietveld 408576698