summaryrefslogtreecommitdiff
path: root/testing/tools/githelper.py
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-10 17:40:11 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-10 22:47:17 +0000
commitfdc3acb42a7983053c53d1445c62654d7ef6b3b2 (patch)
tree9c36f8c70c6afdc57f726739247be7da66d55bbf /testing/tools/githelper.py
parent8fb94e9a2d75cfbc5587c77e9d0b213f81d9b7be (diff)
downloadpdfium-fdc3acb42a7983053c53d1445c62654d7ef6b3b2.tar.xz
Add safetynet_job.py to run safetynet_compare.py periodically.chromium/3182
safetynet.job.py verifies if there were performance changes since its last run. Its state is comprised only of the last checkpoint, and is kept in a directory passed by argument. Results of runs are written to this directory as well. Change-Id: I94e0e176b10fd1d2b18d84f82427f63be107ae17 Reviewed-on: https://pdfium-review.googlesource.com/10370 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'testing/tools/githelper.py')
-rw-r--r--testing/tools/githelper.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/tools/githelper.py b/testing/tools/githelper.py
index 42cc57d304..021ed4e61e 100644
--- a/testing/tools/githelper.py
+++ b/testing/tools/githelper.py
@@ -17,6 +17,10 @@ class GitHelper(object):
"""Checks out a branch."""
subprocess.check_output(['git', 'checkout', branch])
+ def FetchOriginMaster(self):
+ """Fetches new changes on origin/master."""
+ subprocess.check_output(['git', 'fetch', 'origin', 'master'])
+
def StashPush(self):
"""Stashes uncommitted changes."""
output = subprocess.check_output(['git', 'stash', '--include-untracked'])
@@ -37,6 +41,14 @@ class GitHelper(object):
return subprocess.check_output(
['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip()
+ def GetCurrentBranchHash(self):
+ return subprocess.check_output(
+ ['git', 'rev-parse', 'HEAD']).strip()
+
+ def IsCurrentBranchClean(self):
+ output = subprocess.check_output(['git', 'status', '--porcelain'])
+ return not output
+
def BranchExists(self, branch_name):
"""Return whether a branch with the given name exists."""
try: