summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/buildperf/base.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index adc3da3e2c..0e77aae07b 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -96,30 +96,30 @@ class BuildPerfTestResult(unittest.TextTestResult):
96 self.repo = GitRepo('.') 96 self.repo = GitRepo('.')
97 except GitError: 97 except GitError:
98 self.repo = None 98 self.repo = None
99 self.git_revision, self.git_branch = self.get_git_revision() 99 self.git_commit, self.git_branch = self.get_git_revision()
100 self.hostname = socket.gethostname() 100 self.hostname = socket.gethostname()
101 self.start_time = self.elapsed_time = None 101 self.start_time = self.elapsed_time = None
102 self.successes = [] 102 self.successes = []
103 log.info("Using Git branch:revision %s:%s", self.git_branch, 103 log.info("Using Git branch:commit %s:%s", self.git_branch,
104 self.git_revision) 104 self.git_commit)
105 105
106 def get_git_revision(self): 106 def get_git_revision(self):
107 """Get git branch and revision under testing""" 107 """Get git branch and commit under testing"""
108 rev = os.getenv('OE_BUILDPERFTEST_GIT_REVISION') 108 commit = os.getenv('OE_BUILDPERFTEST_GIT_COMMIT')
109 branch = os.getenv('OE_BUILDPERFTEST_GIT_BRANCH') 109 branch = os.getenv('OE_BUILDPERFTEST_GIT_BRANCH')
110 if not self.repo and (not rev or not branch): 110 if not self.repo and (not commit or not branch):
111 log.info("The current working directory doesn't seem to be a Git " 111 log.info("The current working directory doesn't seem to be a Git "
112 "repository clone. You can specify branch and revision " 112 "repository clone. You can specify branch and commit "
113 "used in test results with OE_BUILDPERFTEST_GIT_REVISION " 113 "displayed in test results with OE_BUILDPERFTEST_GIT_BRANCH "
114 "and OE_BUILDPERFTEST_GIT_BRANCH environment variables") 114 "and OE_BUILDPERFTEST_GIT_COMMIT environment variables")
115 else: 115 else:
116 if not rev: 116 if not commit:
117 rev = self.repo.rev_parse('HEAD') 117 commit = self.repo.rev_parse('HEAD^0')
118 if not branch: 118 if not branch:
119 branch = self.repo.get_current_branch() 119 branch = self.repo.get_current_branch()
120 if not branch: 120 if not branch:
121 log.debug('Currently on detached HEAD') 121 log.debug('Currently on detached HEAD')
122 return str(rev), str(branch) 122 return str(commit), str(branch)
123 123
124 def addSuccess(self, test): 124 def addSuccess(self, test):
125 """Record results from successful tests""" 125 """Record results from successful tests"""
@@ -165,9 +165,9 @@ class BuildPerfTestResult(unittest.TextTestResult):
165 'test4': ((7, 1), (10, 2))} 165 'test4': ((7, 1), (10, 2))}
166 166
167 if self.repo: 167 if self.repo:
168 git_tag_rev = self.repo.run_cmd(['describe', self.git_revision]) 168 git_tag_rev = self.repo.run_cmd(['describe', self.git_commit])
169 else: 169 else:
170 git_tag_rev = self.git_revision 170 git_tag_rev = self.git_commit
171 171
172 values = ['0'] * 12 172 values = ['0'] * 12
173 for status, (test, msg) in self.all_results(): 173 for status, (test, msg) in self.all_results():
@@ -183,7 +183,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
183 with open(filename, 'a') as fobj: 183 with open(filename, 'a') as fobj:
184 fobj.write('{},{}:{},{},'.format(self.hostname, 184 fobj.write('{},{}:{},{},'.format(self.hostname,
185 self.git_branch, 185 self.git_branch,
186 self.git_revision, 186 self.git_commit,
187 git_tag_rev)) 187 git_tag_rev))
188 fobj.write(','.join(values) + '\n') 188 fobj.write(','.join(values) + '\n')
189 189