testimage: retrieve ptests directory when ptests fail
PATCH v4 1/1 testimage: retrieve ptests directory when ptests fail
From: Alexis Lothoré <[email protected]>
TESTIMAGE_FAILED_QA_ARTIFACTS is set with a default, minimal list of files to retrieve whenever a runtime test fails.
Add ptests directory to the list so we can get ptests artifacts (eg: logs) whenever a ptest fails. By appending the ptest directory with the multiconfig component in the path, only failing ptests will lead to corresponding ptest artifacts retrieval, instead of all ptests artifacts retrieval. While doing this addition, reinforce default value using "=" operator to make sure to get the default list in any case.
---
This series is now self-contained in a single patch. After going back and forth on where and how to properly add the ptests artifacts, only testimage is finally affected. Additionally to Richard's suggestion in [1], the ptests directory is added conditionally: otherwise, non-ptests images would try to scp a non-existing directory (and it would fail silently)
Link to v3: [1]
Changes in v4:
- keep ptests artifacts addition in testimage.bbclass to avoid parsing order issues
- check for DISTRO_FEATURES to know if ptests artifacts should be retrieved in case of failure
Changes in v3:
- slightly reword commit message body
Changes in v1 (since being picked in new series)
- use += instead of append syntax
[1] https://lore.kernel.org/openembedded-core/[email protected]/
--- meta/classes-recipe/testimage.bbclass | 5 ++++- meta/recipes-core/images/core-image-ptest.bb | 1 - 2 files changed, 4 insertions(+), 2 deletions(-)
meta/classes-recipe/testimage.bbclass +4 -1
@@ -22,11 +22,14 @@ TESTIMAGE_AUTO ??= "0" # each entry in it, if artifact pointed by path description exists on target, # it will be retrieved onto host -TESTIMAGE_FAILED_QA_ARTIFACTS ??= "\ +TESTIMAGE_FAILED_QA_ARTIFACTS = "\ ${localstatedir}/log \ ${sysconfdir}/version \ ${sysconfdir}/os-release" +# If some ptests are run and fail, retrieve corresponding directories +TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/${MCNAME}/ptest', '', d)}" + # You can set (or append to) TEST_SUITES in local.conf to select the tests # which you want to run for your target. # The test names are the module names in meta/lib/oeqa/runtime/cases.
meta/recipes-core/images/core-image-ptest.bb +0 -1
@@ -42,4 +42,3 @@ python () { if not d.getVar("MCNAME"): raise bb.parse.SkipRecipe("No class extension set") } -
Signature · 1 line
2.43.0