1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

core-image-ptest: Switch to BBCLASSEXTEND parallel execution

Replace the two images where tests are run serially with an image
per ptest in the form core-image-ptest-XXX using class extensions.

The original two images are then replaced with dependencies on these
images. This allows parallel execution of the tests.

The downside to this approach is the parsing time of an image generating
this number of class extensions is slow but making it easier to execute
and collect test data should outweigh that.

A useful advantage is that the dependencies of each ptest package are
checked/tested indvidually.

(From OE-Core rev: f3f63ff01971df7d67213a7e7b1294489a5d3c0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-03-09 22:00:08 +00:00
parent f84c07deeb
commit 5850561b05
3 changed files with 61 additions and 40 deletions
@@ -1,25 +1,25 @@
inherit features_check
REQUIRED_DISTRO_FEATURES = "ptest"
require core-image-minimal.bb
require conf/distro/include/ptest-packagelists.inc
DESCRIPTION += "Also includes ptest packages."
DESCRIPTION = "Recipe to trigger execution of all ptest images."
HOMEPAGE = "https://www.yoctoproject.org/"
LICENSE = "MIT"
inherit features_check nopackages
REQUIRED_DISTRO_FEATURES = "ptest"
require conf/distro/include/ptest-packagelists.inc
# Include the full set of ptests
IMAGE_INSTALL += "${PTESTS_FAST} ${PTESTS_SLOW}"
PTESTS = "${PTESTS_FAST} ${PTESTS_SLOW}"
# This image is sufficiently large (~1.8GB) that we need to be careful that it fits in a live
# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
# box) and explicitly add just 1100MB.
# strace-ptest in particular needs more than 500MB
IMAGE_OVERHEAD_FACTOR = "1.0"
IMAGE_ROOTFS_EXTRA_SPACE = "1124288"
do_testimage[noexec] = "1"
do_testimage[depends] = "${@' '.join(['core-image-ptest-'+x.replace('-ptest', '')+':do_testimage' for x in d.getVar('PTESTS').split()])}"
# ptests need more memory than standard to avoid the OOM killer
# also lttng-tools needs /tmp that has at least 2G
QB_MEM = "-m 4096"
do_build[depends] = "${@' '.join(['core-image-ptest-'+x.replace('-ptest', '')+':do_build' for x in d.getVar('PTESTS').split()])}"
# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
PTEST_EXPECT_FAILURE = "1"
# normally image.bbclass would do this
EXCLUDE_FROM_WORLD = "1"
python () {
if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d):
bb.build.addtask("do_testimage", "", "", d)
}
@@ -1,24 +1,6 @@
inherit features_check
REQUIRED_DISTRO_FEATURES = "ptest"
require core-image-ptest-all.bb
require core-image-minimal.bb
require conf/distro/include/ptest-packagelists.inc
DESCRIPTION = "Recipe to trigger execution of all fast ptest images."
# Include only fast (< 30 sec) ptests
IMAGE_INSTALL += "${PTESTS_FAST}"
PTESTS = "${PTESTS_FAST}"
DESCRIPTION += "Also includes ptest packages with fast execution times to allow for more automated QA."
HOMEPAGE = "https://www.yoctoproject.org/"
# This image is sufficiently large (~1.8GB) that it can't actually fit in a live
# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
# box) and explicitly add just 1500MB.
# strace-ptest in particular needs more than 500MB
IMAGE_OVERHEAD_FACTOR = "1.0"
IMAGE_ROOTFS_EXTRA_SPACE = "1524288"
# ptests need more memory than standard to avoid the OOM killer
QB_MEM = "-m 1024"
# Sadly at the moment the fast set of ptests is not robust enough and sporadically fails in a couple of places
PTEST_EXPECT_FAILURE = "1"
@@ -0,0 +1,39 @@
inherit features_check
REQUIRED_DISTRO_FEATURES = "ptest"
require core-image-minimal.bb
require conf/distro/include/ptest-packagelists.inc
DESCRIPTION += "Also including the ${MCNAME} ptest package."
HOMEPAGE = "https://www.yoctoproject.org/"
PTESTS = "${PTESTS_SLOW} ${PTESTS_FAST}"
IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
BBCLASSEXTEND = "${@' '.join(['mcextend:'+x.replace('-ptest', '') for x in d.getVar('PTESTS').split()])}"
# The image can sufficiently large (~1.8GB) that we need to be careful that it fits in a live
# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
# box) and explicitly add up to 1500MB.
# strace-ptest in particular needs more than 500MB
IMAGE_OVERHEAD_FACTOR = "1.0"
IMAGE_ROOTFS_EXTRA_SPACE = "324288"
IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1024288"
IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288"
# ptests need more memory than standard to avoid the OOM killer
QB_MEM = "-m 1024"
QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096"
QB_MEM:virtclass-mcextend-python3-cryptography = "-m 4096"
TEST_SUITES = "ping ssh parselogs ptest"
# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
PTEST_EXPECT_FAILURE = "1"
python () {
if not d.getVar("MCNAME"):
raise bb.parse.SkipRecipe("No class extension set")
}