Permalink
Browse files

Include the git commit id and repository url in results.json (#3257)

We already generate a commit_id.txt file when we do a full continuous
run, but not when we run tests manually.  With this change, now we always
record the commit id, and it's in results.json, which is a more
convenient home.
  • Loading branch information...
michaelhixson authored and nbrady-techempower committed Feb 6, 2018
1 parent 692232a commit 329823652423ae300120f4d73826ab88ffa110ea
Showing with 9 additions and 0 deletions.
  1. +9 −0 toolset/benchmark/benchmarker.py
@@ -869,6 +869,12 @@ def __load_results(self):
except (ValueError, IOError):
pass
def __get_git_commit_id(self):
return subprocess.check_output('git rev-parse HEAD', shell=True).strip()
def __get_git_repository_url(self):
return subprocess.check_output('git config --get remote.origin.url', shell=True).strip()
############################################################
# __finish
############################################################
@@ -985,6 +991,9 @@ def __init__(self, args):
self.results['uuid'] = str(uuid.uuid4())
self.results['name'] = datetime.now().strftime(self.results_name)
self.results['environmentDescription'] = self.results_environment
self.results['git'] = dict()
self.results['git']['commitId'] = self.__get_git_commit_id()
self.results['git']['repositoryUrl'] = self.__get_git_repository_url()
self.results['startTime'] = int(round(time.time() * 1000))
self.results['completionTime'] = None
self.results['concurrencyLevels'] = self.concurrency_levels

0 comments on commit 3298236

Please sign in to comment.