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

Unified Diff: appengine/findit/model/flake/flake_try_job.py

Issue 2605803002: [Findit] Refactoring WfTryJobData into BaseTryJobData, WfTryJobData, and FlakeTryJobData (Closed)
Patch Set: Fixing code coverage Created 3 years, 11 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 | « appengine/findit/model/base_try_job_data.py ('k') | appengine/findit/model/flake/flake_try_job_data.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/flake/flake_try_job.py
diff --git a/appengine/findit/model/flake/flake_try_job.py b/appengine/findit/model/flake/flake_try_job.py
index 0ffeac3d5df0b0be93c231cb58ce527208e40b00..17819d9c2917ab156754b72626e153a6a0d95d17 100644
--- a/appengine/findit/model/flake/flake_try_job.py
+++ b/appengine/findit/model/flake/flake_try_job.py
@@ -23,6 +23,30 @@ class FlakeTryJob(BaseTryJob):
# ]
flake_results = ndb.JsonProperty(indexed=False, compressed=True)
+ @classmethod
+ def GetStepName(cls, key):
+ return key.pairs()[0][1].split('/')[2]
+
+ @classmethod
+ def GetTestName(cls, key):
+ return base64.b64decode(key.pairs()[0][1].split('/')[3])
+
+ @classmethod
+ def GetGitHash(cls, key):
+ return key.pairs()[0][1].split('/')[4]
+
+ @ndb.ComputedProperty
+ def step_name(self):
+ return self.GetStepName(self.key)
+
+ @ndb.ComputedProperty
+ def test_name(self):
+ return self.GetTestName(self.key)
+
+ @ndb.ComputedProperty
+ def git_hash(self):
+ return self.GetGitHash(self.key)
+
@staticmethod
def _CreateTryJobId(master_name, builder_name, step_name, test_name,
git_hash): # pragma: no cover
« no previous file with comments | « appengine/findit/model/base_try_job_data.py ('k') | appengine/findit/model/flake/flake_try_job_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698