From: Markus Lehtonen Date: Mon, 29 Aug 2016 19:48:23 +0000 (+0300) Subject: oeqa.buildperf: strip date from buildstats directory path X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~24460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95138cdc70bb7f9b7ab74e1d83305f009790dccc;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa.buildperf: strip date from buildstats directory path Archive buildstats in a directory like 'buildstats' instead of something like 'buildstats/20160513120000'. Signed-off-by: Markus Lehtonen Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index eed026681b7..4918e793a15 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py @@ -395,7 +395,11 @@ class BuildPerfTestCase(unittest.TestCase): def save_buildstats(self): """Save buildstats""" - shutil.move(self.bb_vars['BUILDSTATS_BASE'], + 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) + shutil.move(os.path.join(self.bb_vars['BUILDSTATS_BASE'], bs_dirs[-1]), os.path.join(self.out_dir, 'buildstats-' + self.name)) def rm_tmp(self):