oeqa.buildperf: rename buildstats directories

Change directory name from 'buildstats-<test_name>' to just
'buildstats'. However, this patch adds the possibility to label
buildstats directory name with a postfix which makes it possible to save
multiple buildstats per test, for example.

(From OE-Core rev: 8997556040b2e7bfcfa6a75d4d97eb2e32207217)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen 2016-08-29 22:48:25 +03:00 committed by Richard Purdie
parent 6d75f39f09
commit 33a38bc18a
1 changed files with 3 additions and 2 deletions

View File

@ -394,14 +394,15 @@ class BuildPerfTestCase(unittest.TestCase):
# Append to 'sizes' array for globalres log
self.sizes.append(str(size))
def save_buildstats(self):
def save_buildstats(self, label=None):
"""Save buildstats"""
bs_dirs = os.listdir(self.bb_vars['BUILDSTATS_BASE'])
if len(bs_dirs) > 1:
log.warning("Multiple buildstats found for test %s, only "
"archiving the last one", self.name)
postfix = '-' + label if label else ''
shutil.move(os.path.join(self.bb_vars['BUILDSTATS_BASE'], bs_dirs[-1]),
os.path.join(self.out_dir, 'buildstats-' + self.name))
os.path.join(self.out_dir, 'buildstats' + postfix))
def rm_tmp(self):
"""Cleanup temporary/intermediate files and directories"""