]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest: Use extraresults on self instead of self.tc
authorNathan Rossi <nathan@nathanrossi.com>
Sat, 7 Sep 2019 12:55:06 +0000 (12:55 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 7 Sep 2019 20:56:43 +0000 (21:56 +0100)
In order to take advantage of multiprocess execution of tests the
extraresults must be passed through the TestResult. With changes to how
oeqa/core handles test cases the extraresults attribute of the testcase
is passed to the TestResult, with passing across process boundaries
handled automatically.

(From OE-Core rev: 6a1b0c2003a0b4a1983f9494440e6ea02dc25585)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/binutils.py
meta/lib/oeqa/selftest/cases/gcc.py
meta/lib/oeqa/selftest/cases/glibc.py
meta/lib/oeqa/selftest/cases/reproducible.py

index 7f887959e41fc9cd7c07f4f07dacaee637bff16e..759cd9b8ffb0dd4178cb7d448ebfbb05b55142df 100644 (file)
@@ -16,15 +16,6 @@ def parse_values(content):
 
 @OETestTag("machine")
 class BinutilsCrossSelfTest(OESelftestTestCase):
-    @classmethod
-    def setUpClass(cls):
-        super().setUpClass()
-        if not hasattr(cls.tc, "extraresults"):
-            cls.tc.extraresults = {}
-
-        if "ptestresult.sections" not in cls.tc.extraresults:
-            cls.tc.extraresults["ptestresult.sections"] = {}
-
     def test_binutils(self):
         self.run_binutils("binutils")
 
@@ -46,7 +37,7 @@ class BinutilsCrossSelfTest(OESelftestTestCase):
         bitbake("{0} -c check".format(recipe))
 
         ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
-        self.tc.extraresults["ptestresult.sections"][ptestsuite] = {}
+        self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}}
 
         sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite))
         if not os.path.exists(sumspath):
@@ -54,5 +45,5 @@ class BinutilsCrossSelfTest(OESelftestTestCase):
 
         with open(sumspath, "r") as f:
             for test, result in parse_values(f):
-                self.tc.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+                self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
 
index f4fed40ea5b3e4a185e3b5d53a2cd373ce399039..24ee66a2ae1574bd6eff712726a56ab4ecdab1e0 100644 (file)
@@ -13,15 +13,6 @@ def parse_values(content):
 
 @OETestTag("machine")
 class GccSelfTest(OESelftestTestCase):
-    @classmethod
-    def setUpClass(cls):
-        super().setUpClass()
-        if not hasattr(cls.tc, "extraresults"):
-            cls.tc.extraresults = {}
-
-        if "ptestresult.sections" not in cls.tc.extraresults:
-            cls.tc.extraresults["ptestresult.sections"] = {}
-
     def gcc_runtime_check_skip(self, suite):
         targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split()
         if suite not in targets:
@@ -71,6 +62,7 @@ class GccSelfTest(OESelftestTestCase):
         bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe)
         builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"]
 
+        self.extraresults = {"ptestresult.sections" : {}}
         for suite in suites:
             sumspath = os.path.join(builddir, "gcc", "testsuite", suite, "{0}.sum".format(suite))
             if not os.path.exists(sumspath): # check in target dirs
@@ -80,10 +72,10 @@ class GccSelfTest(OESelftestTestCase):
 
             ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite
             ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite
-            self.tc.extraresults["ptestresult.sections"][ptestsuite] = {}
+            self.extraresults["ptestresult.sections"][ptestsuite] = {}
             with open(sumspath, "r") as f:
                 for test, result in parse_values(f):
-                    self.tc.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+                    self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
 
 class GccSelfTestSystemEmulated(GccSelfTest):
     default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
index 4d0c13131b7000f316c74d42dc376f7e7ce7a92e..e13de8701470c355ede3261981529a4a4bd1f61b 100644 (file)
@@ -15,15 +15,6 @@ def parse_values(content):
 
 @OETestTag("machine")
 class GlibcSelfTest(OESelftestTestCase):
-    @classmethod
-    def setUpClass(cls):
-        super().setUpClass()
-        if not hasattr(cls.tc, "extraresults"):
-            cls.tc.extraresults = {}
-
-        if "ptestresult.sections" not in cls.tc.extraresults:
-            cls.tc.extraresults["ptestresult.sections"] = {}
-
     def test_glibc(self):
         self.glibc_run_check()
 
@@ -44,10 +35,10 @@ class GlibcSelfTest(OESelftestTestCase):
         builddir = get_bb_var("B", "glibc-testsuite")
 
         ptestsuite = "glibc-user" if ssh is None else "glibc"
-        self.tc.extraresults["ptestresult.sections"][ptestsuite] = {}
+        self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}}
         with open(os.path.join(builddir, "tests.sum"), "r") as f:
             for test, result in parse_values(f):
-                self.tc.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+                self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
 
 class GlibcSelfTestSystemEmulated(GlibcSelfTest):
     default_installed_packages = [
index ffb405af20fc5b3138927101d814e0bb45fdabfe..eee09d3fb263d9b07694739c6a594b4d2c977978 100644 (file)
@@ -82,15 +82,12 @@ class ReproducibleTests(OESelftestTestCase):
         for v in needed_vars:
             setattr(self, v.lower(), bb_vars[v])
 
-        if not hasattr(self.tc, "extraresults"):
-            self.tc.extraresults = {}
-        self.extras = self.tc.extraresults
-
-        self.extras.setdefault('reproducible.rawlogs', {})['log'] = ''
-        self.extras.setdefault('reproducible', {}).setdefault('files', {})
+        self.extrasresults = {}
+        self.extrasresults.setdefault('reproducible.rawlogs', {})['log'] = ''
+        self.extrasresults.setdefault('reproducible', {}).setdefault('files', {})
 
     def append_to_log(self, msg):
-        self.extras['reproducible.rawlogs']['log'] += msg
+        self.extrasresults['reproducible.rawlogs']['log'] += msg
 
     def compare_packages(self, reference_dir, test_dir, diffutils_sysroot):
         result = PackageCompareResults()
@@ -117,7 +114,7 @@ class ReproducibleTests(OESelftestTestCase):
         return result
 
     def write_package_list(self, package_class, name, packages):
-        self.extras['reproducible']['files'].setdefault(package_class, {})[name] = [
+        self.extrasresults['reproducible']['files'].setdefault(package_class, {})[name] = [
                 {'reference': p.reference, 'test': p.test} for p in packages]
 
     def test_reproducible_builds(self):