]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa: reproducible: Record packages in test results
authorJoshua Watt <jpewhacker@gmail.com>
Tue, 27 Aug 2019 19:33:48 +0000 (14:33 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Aug 2019 12:37:43 +0000 (13:37 +0100)
Records the results of the reproducibility analysis in the JSON test
results file. This makes it easier to do post-test analysis on the
packages.

[YOCTO #13324]

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/reproducible.py

index 2b8b4e9e88eaf905bc3a031162efcfb08656a227..ebfa88fbc552743469f3c752ca6d0dab9de574b4 100644 (file)
@@ -8,6 +8,7 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 import functools
 import multiprocessing
 import textwrap
+import json
 import unittest
 
 MISSING = 'MISSING'
@@ -86,6 +87,7 @@ class ReproducibleTests(OESelftestTestCase):
         self.extras = self.tc.extraresults
 
         self.extras.setdefault('reproducible.rawlogs', {})['log'] = ''
+        self.extras.setdefault('reproducible', {}).setdefault('files', {})
 
     def append_to_log(self, msg):
         self.extras['reproducible.rawlogs']['log'] += msg
@@ -114,6 +116,10 @@ class ReproducibleTests(OESelftestTestCase):
         result.sort()
         return result
 
+    def write_package_list(self, package_class, name, packages):
+        self.extras['reproducible']['files'].setdefault(package_class, {})[name] = [
+                {'reference': p.reference, 'test': p.test} for p in packages]
+
     @unittest.skip("Reproducible builds do not yet pass")
     def test_reproducible_builds(self):
         capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes]
@@ -162,6 +168,10 @@ class ReproducibleTests(OESelftestTestCase):
 
                 self.append_to_log('\n'.join("%s: %s" % (r.status, r.test) for r in result.total))
 
+                self.write_package_list(package_class, 'missing', result.missing)
+                self.write_package_list(package_class, 'different', result.different)
+                self.write_package_list(package_class, 'same', result.same)
+
                 if result.missing or result.different:
                     self.fail("The following %s packages are missing or different: %s" %
                             (c, ' '.join(r.test for r in (result.missing + result.different))))