Bug 11142 - Use artificial recipes for oe-selftest where possible to reduce work
Summary: Use artificial recipes for oe-selftest where possible to reduce work
Status: RESOLVED FIXED
Alias: None
Product: Build Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: Low enhancement
Target Milestone: 4.99
Assignee: Thomas Roos
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2017-03-10 13:25 UTC by Joshua Lock
Modified: 2023-06-01 15:14 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Lock 2017-03-10 13:25:20 UTC
Several of the tests in oe-selftest invoke bitbake with recipe targets, in many cases building relatively complex recipes with non-trivial dependency chains.

For several tests fetching and building isn't strictly necessary and the needs of the test could be as easily met with an artificial recipe in meta-selftest which uses a local file as its source, one immediate example which prompted this report is oescripts.TestScripts.test_cleanup_workdir

We should review the targets bitbake is invoked with in oe-selftest and aim to:

* use artificial recipes, with a local file source, where possible
* reduce reliance on recipes being present in oe-core, i.e. where practical oe-selftest should use recipes contained in meta-selftest to ensure the results are easily repeatable and independent of unrelated changes to oe-core i.e. the recent (at time of reporting) removal of GPLv2 recipes.
Comment 1 Jose Perez C 2017-08-30 15:35:00 UTC
Moving to 2.5 and reassign this bug to Jair as he  will be working on oeqa enhancements
Comment 2 Thomas Roos 2023-04-21 11:37:31 UTC
So e.g. a simple helloworld.c + recipe should be added to oe-core?
Comment 3 Thomas Roos 2023-04-21 11:59:33 UTC
found this one here: poky/meta-skeleton/recipes-skeleton/hello-single
-> should this then moved/copied to meta-selftest/recipes-test ?
Comment 4 Randy MacLeod 2023-04-21 18:24:34 UTC
Thomas, If you don't get an answer here by early next week, try the email list, perhaps with a patch to focus the discussion. Joshua is mostly on leave for weeks or maybe 2 months so he may not reply quickly if at all. (I'm away next week as well).
Comment 5 Thomas Roos 2023-04-28 11:26:50 UTC
Hi, just was working on this today again, so what I found:
bbtests.BitbakeTests.test_event_handler
is using this:
bitbake('m4-native')

running just this test takes
orig: Ran 1 test in 75.741s

replaced with hello (copied from oe-skel...)
mod:  Ran 1 test in 678.986s
-> so it seems that building a native version will speed up already this a lot.
-> trying hello-native: 29.84s

Wondering if we should always just use -native recipes, then?

Other locations I found, but did not replace or check them, yet:

test_recipe = 'zlib'

test_recipe = 'ed'

bitbake('hicolor-icon-theme')

testrecipe = 'lighttpd'



IMO it makes sense to have a fast hello world (-native?) recipe in meta-selftest /recipes-test to use in some tests where m4-native, zlib, ed... is used! 
Or may there is even a faster idea? It really just depends on the specific test, what should be tested.

Please, any thoughts on this?
Also, I will create a patch for this and post it to the mailing list for discussion as a next step.