From fdc3acb42a7983053c53d1445c62654d7ef6b3b2 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 10 Aug 2017 17:40:11 -0400 Subject: Add safetynet_job.py to run safetynet_compare.py periodically. 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 Reviewed-by: Lei Zhang --- testing/tools/githelper.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testing/tools/githelper.py') 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: -- cgit v1.2.3