mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 00:49:33 +02:00
oeqa: reproducible: Record packages in test results
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] (From OE-Core rev: 6c357c8eee322163da96df676a54ff70a0bdc911) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
a0ce9a8bbc
commit
977aee76cf
@@ -8,6 +8,7 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
|
|||||||
import functools
|
import functools
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import textwrap
|
import textwrap
|
||||||
|
import json
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
MISSING = 'MISSING'
|
MISSING = 'MISSING'
|
||||||
@@ -86,6 +87,7 @@ class ReproducibleTests(OESelftestTestCase):
|
|||||||
self.extras = self.tc.extraresults
|
self.extras = self.tc.extraresults
|
||||||
|
|
||||||
self.extras.setdefault('reproducible.rawlogs', {})['log'] = ''
|
self.extras.setdefault('reproducible.rawlogs', {})['log'] = ''
|
||||||
|
self.extras.setdefault('reproducible', {}).setdefault('files', {})
|
||||||
|
|
||||||
def append_to_log(self, msg):
|
def append_to_log(self, msg):
|
||||||
self.extras['reproducible.rawlogs']['log'] += msg
|
self.extras['reproducible.rawlogs']['log'] += msg
|
||||||
@@ -114,6 +116,10 @@ class ReproducibleTests(OESelftestTestCase):
|
|||||||
result.sort()
|
result.sort()
|
||||||
return result
|
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")
|
@unittest.skip("Reproducible builds do not yet pass")
|
||||||
def test_reproducible_builds(self):
|
def test_reproducible_builds(self):
|
||||||
capture_vars = ['DEPLOY_DIR_' + c.upper() for c in self.package_classes]
|
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.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:
|
if result.missing or result.different:
|
||||||
self.fail("The following %s packages are missing or different: %s" %
|
self.fail("The following %s packages are missing or different: %s" %
|
||||||
(c, ' '.join(r.test for r in (result.missing + result.different))))
|
(c, ' '.join(r.test for r in (result.missing + result.different))))
|
||||||
|
|||||||
Reference in New Issue
Block a user