Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	Openembedded-core@lists.openembedded.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Mikko Rapeli <mikko.rapeli@linaro.org>
Subject: Re: [OE-Core][PATCH v3 1/2] testimage: move TESTIMAGE_FAILED_QA_ARTIFACTS default to core-image
Date: Tue, 6 Feb 2024 14:23:01 +0100	[thread overview]
Message-ID: <349bf837-7540-4aa0-878f-cdbfe2b3c0b8@bootlin.com> (raw)
In-Reply-To: <cbd17e6e8b5777ab7f926dc2af99468541f803bd.camel@linuxfoundation.org>

On 2/6/24 13:00, Richard Purdie wrote:
> On Tue, 2024-02-06 at 12:09 +0100, Alexis Lothoré wrote:
>> So I've did multiple attempts to make this work, and I see no way to define the
>> default value in testimage.bbclass with "=", and add content to it in
>> core-image-ptest.bbwith "+=". My understanding is that testimage is always
>> parsed after core-image-ptest.bb, so there is no nice way to set its default
>> value in there:
>> - "=" will always overwrite ptests artifacts set with "+="
>> - "?=" or "??=" will always be overwritten by ptests artifacts set with "+="
>> My configuration relies on IMAGE_CLASSES += 'testimage', which is also done in CI.
> 
> The issue is this:
> 
> classes-recipe/image.bbclass:inherit_defer ${IMGCLASSES}
>
> since this is deferred to after the recipe is parsed.

Ah, thank you for the explanation, I was not aware of this defer mechanism.

>> Still, I understand your concern about keeping default value in
>> testimage.bbclass. The only compromise I see here to both keep the default value
>> in testimage and be able to override it at user level is not to enrich it in
>> core-image-ptest but to redefine it:
>>
>> diff --git a/meta/recipes-core/images/core-image-ptest.bb
>> b/meta/recipes-core/images/core-image-ptest.bb
>> index fb96c542c0a3..4a90181afd83 100644
>> --- a/meta/recipes-core/images/core-image-ptest.bb
>> +++ b/meta/recipes-core/images/core-image-ptest.bb
>> @@ -43,5 +43,8 @@ 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"
>> +TESTIMAGE_FAILED_QA_ARTIFACTS = "\
>> +    ${localstatedir}/log \
>> +    ${sysconfdir}/version \
>> +    ${sysconfdir}/os-release \
>> +    ${libdir}/${MCNAME}/ptest"
>>
>> That's for example what is done with TEST_SUITES. In this setup, we can keep a
>> default value in testimage, and override it as needed with append/prepend/remove
>> syntax at user level.
>>
>> I'll wait a bit in case there's any comment or concern about this approach, and
>> then send a new version.
> 
> I see two options:
> 
> a) Make testimage.bbclass a +=
> 
> or
> 
> b) Put the new entry into testimage.bbclass even if it is ptest
> specific.
> 
> 
> I'm leaning to doing both, make it a += and just put it there by
> default in case someone includes ptests in a non ptest image.

Ok, sounds good to me too and ptests artifact retrieval seems to behave properly
even when defined in testimage. I'll submit a new version which keeps the
default artifact list in testimage, and adds immediately ptests artifacts to it.

Thanks for the guidance :)

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



  reply	other threads:[~2024-02-06 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 14:37 [OE-Core][PATCH v3 0/2] testimage: enable artifacts retrieval for failed tests Alexis Lothoré
2024-02-05 14:37 ` [OE-Core][PATCH v3 1/2] testimage: move TESTIMAGE_FAILED_QA_ARTIFACTS default to core-image Alexis Lothoré
2024-02-05 15:08   ` Richard Purdie
2024-02-05 19:22     ` Alexis Lothoré
2024-02-06 10:29       ` Richard Purdie
2024-02-06 11:09       ` Alexis Lothoré
2024-02-06 12:00         ` Richard Purdie
2024-02-06 13:23           ` Alexis Lothoré [this message]
2024-02-05 14:37 ` [OE-Core][PATCH v3 2/2] core-image-ptest: retrieve ptests directory when ptests fail Alexis Lothoré

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=349bf837-7540-4aa0-878f-cdbfe2b3c0b8@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=Openembedded-core@lists.openembedded.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=mikko.rapeli@linaro.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox