Skip to contentSkip to conversation

testimage: enable artifacts retrieval for failed tests

PATCH Superseded Alexis Lothoré 2 participants 5 messages Feb 3, 2024 1 message not in the archive

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover testimage: enable artifacts retrieval for failed tests

Hello,
this small series is a new version of failed ptests artifacts retrieval series.
The first version can be found in [1].

This new version moves default TESTIMAGE_FAILED_QA_ARTIFACTS
in core-image class to make sure all CI images get this default value. With this setup:
- "standard" images running tests leads to default artifact list to be stored
- if the image has ptest feature enabled, failed ptests directories will be retrieved
- artifacts lists can be customized: TESTIMAGE_FAILED_QA_ARTIFACTS:append = " <file1> <file2>..."

The feature has been tested with core-image-sato and core-image-ptest-fast (running only a subtests of configured tests)

[1] https://lore.kernel.org/openembedded-core/[email protected]/
[2] https://lore.kernel.org/openembedded-core/[email protected]/

Alexis Lothoré (2):
testimage: move TESTIMAGE_FAILED_QA_ARTIFACTS default value to
core-image-minimal
core-image-ptest: retrieve ptests directory when ptests fail

 meta/classes-recipe/core-image.bbclass       | 8 ++++++++
 meta/classes-recipe/testimage.bbclass        | 9 ---------
 meta/recipes-core/images/core-image-ptest.bb | 2 ++
 3 files changed, 10 insertions(+), 9 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/2 testimage: move TESTIMAGE_FAILED_QA_ARTIFACTS default value to core-image-minimal

From: Alexis Lothoré <[email protected]>

TESTIMAGE_FAILED_QA_ARTIFACTS currently sets a default list of files to be saved whenever some tests fail. Unfortunately, this default value is very easily discarded, because TESTIMAGE_FAILED_QA_ARTIFACTS is expected to be enriched by some core recipes (example: ptest images) which are often parsed before testimage.bbclass. Those core recipes could still manage to get the default value AND add some files by using override syntax, but then it makes it difficult for downstream recipes or bbappend files to tune this variable.

Allow to set this default value and make sure it is not overwritten by recipes wanting to tune it, by setting the default value in core-image.
While doing so, set it as a default value instead of a weak default value.

---
Changes in v2:
- set the default value in core-image instead of core-image-minimal

---
 meta/classes-recipe/core-image.bbclass | 8 ++++++++
 meta/classes-recipe/testimage.bbclass  | 9 ---------
 2 files changed, 8 insertions(+), 9 deletions(-)
meta/classes-recipe/core-image.bbclass +8 -0
index 40fc15cb04f2..8ca64a95a318 100644
@@ -83,4 +83,12 @@ CORE_IMAGE_EXTRA_INSTALL ?= ""
 
 IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
 
+# When any test fails, TESTIMAGE_FAILED_QA_ARTIFACTS will be parsed and for
+# each entry in it, if artifact pointed by path description exists on target,
+# it will be retrieved onto host
+TESTIMAGE_FAILED_QA_ARTIFACTS ?= "\
+    ${localstatedir}/log \
+    ${sysconfdir}/version \
+    ${sysconfdir}/os-release"
+
 inherit image
meta/classes-recipe/testimage.bbclass +0 -9
index f36d9418914f..cfda5b631ba8 100644
@@ -18,15 +18,6 @@ inherit image-artifact-names
 
 TESTIMAGE_AUTO ??= "0"
 
-# When any test fails, TESTIMAGE_FAILED_QA ARTIFACTS will be parsed and for
-# each entry in it, if artifact pointed by path description exists on target,
-# it will be retrieved onto host
-
-TESTIMAGE_FAILED_QA_ARTIFACTS ??= "\
-    ${localstatedir}/log \
-    ${sysconfdir}/version \
-    ${sysconfdir}/os-release"
-
 # 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.
Signature · 1 line
2.43.0
#2 lore raw

Patchtest results for [OE-Core][PATCH v2 1/2] testimage: move TESTIMAGE_FAILED_QA_ARTIFACTS default value to core-image-minimal

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---

Testing patch /home/patchtest/share/mboxes/v2-1-2-testimage-move-TESTIMAGE_FAILED_QA_ARTIFACTS-default-value-to-core-image-minimal.patch
FAIL: test shortlog length: Edit shortlog so that it is 90 characters or less (currently 96 characters) (test_mbox.TestMbox.test_shortlog_length)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#3 lore raw

PATCH v2 2/2 core-image-ptest: retrieve ptests directory when ptests fail

In reply to Alexis Lothoré

From: Alexis Lothoré <[email protected]>

TESTIMAGE_FAILED_QA_ARTIFACTS is defined in core-image-minimal with a minimal list of files to retrieve whenever a runtime test fails. By appending the ptest directory only in core-image-ptest.bb, thanks to multiconfig feature used in the recipe, only failing ptests will lead to corresponding ptest artifacts retrieval, instead of all ptests artifacts retrieval.

---
This patch was present in the original artifacts series ([1])

Changes since previous series:
- use += instead of append syntax

[1] https://lore.kernel.org/openembedded-core/[email protected]/

---
 meta/recipes-core/images/core-image-ptest.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/images/core-image-ptest.bb +2 -0
index b6f5c2fd6049..fb96c542c0a3 100644
@@ -43,3 +43,5 @@ python () {
         raise bb.parse.SkipRecipe("No class extension set")
 }
 
+# Include ptest directory in artifacts to retrieve if there is a failed test
+TESTIMAGE_FAILED_QA_ARTIFACTS += "${libdir}/${MCNAME}/ptest"
Signature · 1 line
2.43.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Re: [OE-Core][PATCH v2 1/2] testimage: move TESTIMAGE_FAILED_QA_ARTIFACTS default value to core-image-minimal

Quoted 11 lines · Alexis Lothoré via lists.openembedded.org

From: Alexis Lothoré <[email protected]>

TESTIMAGE_FAILED_QA_ARTIFACTS currently sets a default list of files to be saved whenever some tests fail. Unfortunately, this default value is very easily discarded, because TESTIMAGE_FAILED_QA_ARTIFACTS is expected to be enriched by some core recipes (example: ptest images) which are often parsed before testimage.bbclass. Those core recipes could still manage to get the default value AND add some files by using override syntax, but then it makes it difficult for downstream recipes or bbappend files to tune this variable.

Quoted 4 lines

Allow to set this default value and make sure it is not overwritten by recipes wanting to tune it, by setting the default value in core-image.
While doing so, set it as a default value instead of a weak default value.

And I realize that I forgot to remove "minimal" from the commit message, which is not true anymore for this version. I'll wait a bit before resending, it looks like I have some formatting issues detected by patchtest too

Signature · 3 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com