Skip to contentSkip to conversation

Fixes for oe-build-perf-test

PATCH New Markus Lehtonen 1 participant 3 messages Sep 7, 2016

lore
Share & tools
lore
#0 lore raw

cover Fixes for oe-build-perf-test

Two small miscellanious fixes to build perf tests.

Markus Lehtonen (2):
oeqa.buildperf: try harder when splitting 'nevr' string oeqa.buildperf: be sure to use the latest buildstats

 meta/lib/oeqa/buildperf/base.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.6.6
#1 lore raw

PATCH 1/2 oeqa.buildperf: try harder when splitting 'nevr' string

Try to be more intelligent when splitting out recipe name, epoch, version and revision from the buildstat directory name. Previous assumption was that package versions never contain a dash but obviously that is not necessarily true. The new assumption is that the package version starts with a number.

---
 meta/lib/oeqa/buildperf/base.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/lib/oeqa/buildperf/base.py +4 -2
index 2325cd1..7dfb2bf 100644
@@ -425,8 +425,10 @@ class BuildPerfTestCase(unittest.TestCase):
         """Save buildstats"""
         def split_nevr(nevr):
             """Split name and version information from recipe "nevr" string"""
-            name, e_v, revision = nevr.rsplit('-', 2)
-            match = re.match(r'^((?P<epoch>[0-9]{1,5})_)?(?P<version>.*)$', e_v)
+            n_e_v, revision = nevr.rsplit('-', 1)
+            match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[0-9]\S*)$',
+                             n_e_v)
+            name = match.group('name')
             version = match.group('version')
             epoch = match.group('epoch')
             return name, epoch, version, revision
Signature · 1 line
2.6.6
#2 lore raw

PATCH 2/2 oeqa.buildperf: be sure to use the latest buildstats

In reply to Markus Lehtonen

Be sure to take the latest buildstats if multiple buildstats are found.

---
 meta/lib/oeqa/buildperf/base.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/buildperf/base.py +1 -1
index 7dfb2bf..9700c05 100644
@@ -466,7 +466,7 @@ class BuildPerfTestCase(unittest.TestCase):
             return bs_json
 
         log.info('Saving buildstats in JSON format')
-        bs_dirs = os.listdir(self.bb_vars['BUILDSTATS_BASE'])
+        bs_dirs = sorted(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)
Signature · 1 line
2.6.6