]> code.ossystems Code Review - openembedded-core.git/commitdiff
ptest: add an option to enforce a failure (e.g. ptests are required to pass)
authorAlexander Kanavin <alex.kanavin@gmail.com>
Sun, 23 Feb 2020 13:52:31 +0000 (14:52 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Feb 2020 10:41:15 +0000 (10:41 +0000)
This can be useful with a more specific, targeted and robust set of ptest
packages; the benefit is that ptest regressions are caught as they happen
and can be more easily traced to changes that caused them.

The existing AB ptest image continues to be expected to fail, my observation
of the AB runs is that the full set of ptests is not robust enough
(particularly around socket/network related tests) and sporadically fails
in random places. This can probably be addressed by making ptests exclusive
to a worker (e.g. there is no other workload happening at the same time as
ptests).

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/ptest.py
meta/recipes-sato/images/core-image-sato-sdk-ptest.bb

index eb284df439b31c84a2f1682a7d00e41d2ab0682d..5626f707b993687c0229ac765c30ac40c2363523 100644 (file)
@@ -18,7 +18,20 @@ class PtestRunnerTest(OERuntimeTestCase):
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     @OEHasPackage(['ptest-runner'])
     @unittest.expectedFailure
-    def test_ptestrunner(self):
+    def test_ptestrunner_expectfail(self):
+        if not self.td.get('PTEST_EXPECT_FAILURE'):
+            self.skipTest('Cannot run ptests with @expectedFailure as ptests are required to pass')
+        self.do_ptestrunner()
+
+    @skipIfNotFeature('ptest', 'Test requires ptest to be in DISTRO_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(['ptest-runner'])
+    def test_ptestrunner_expectsuccess(self):
+        if self.td.get('PTEST_EXPECT_FAILURE'):
+            self.skipTest('Cannot run ptests without @expectedFailure as ptests are expected to fail')
+        self.do_ptestrunner()
+
+    def do_ptestrunner(self):
         status, output = self.target.run('which ptest-runner', 0)
         if status != 0:
             self.skipTest("No -ptest packages are installed in the image")
index 58c257c49fb53927aaf5f010102c063844bfeb93..bf749acd79c684789442731206de2238bba5862a 100644 (file)
@@ -18,3 +18,6 @@ IMAGE_ROOTFS_EXTRA_SPACE = "1124288"
 # ptests need more memory than standard to avoid the OOM killer
 # also lttng-tools needs /tmp that has at least 1G
 QB_MEM = "-m 2048"
+
+# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
+PTEST_EXPECT_FAILURE = "1"