-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zephyr in tree samples CI coverage criteria and elastic quality maintain policy enhancement #85359
Comments
As I understand the problem is in different focus on samples at community CI and from vendor's CI perspective on how much resources to assign on samples' verification and who takes care of issues found there. I think one way to manage the scope for samples at the project's CI is to list the eligible samples as an explicit test plan in dedicated yaml config files (with maintainers assigned) using |
per current definition: A sample is a concise Zephyr application that provides an accessible overview of one or more features, subsystems, or modules. This includes kernel services, drivers, protocols, etc. Samples should be limited in scope and should focus only on demonstrating non-trivial or essential aspects of the subsystem(s) or module(s) being highlighted. https://docs.zephyrproject.org/latest/samples/sample_definition_and_criteria.html#definition-and-criteria already talks about portability and being generic. Samples are provided to demonstrate functionality of a subsystem, it is usually provided alongside a new feature and provided by the same contributor. A sample author is expected to document and test functionality of the sample and provide information about hardware the sample can run on. A sample author is not expected to port and verify the sample on all platforms supported by Zephyr. Ideally we want samples to be written and used by available platforms and where applicable, run on simulators. Samples serve as reference for application writers and users of Zephyr, they are not neither used to verify functionality and correctness of features in Zephyr, nor for platform verification. CI is used to verify that the sample as provided and as documented and on the supported hardware, as provided by the author. Most samples are verified for buildability in CI, CI does not verify if a sample works as documented. Some samples however can be verified in CI based on the output they provide on the console and get full coverage in CI using simulation platforms.
sure, see above.
Nice goal, but before getting "full function validation" on samples we better focus on "full function validation" of Zephyr features and invest in functional testing in general, samples might benefit from that, but also adds lots of constraints on how you right samples and gets us in the realm of application testing, which is at a completely different level. We have this in some areas (Bluetooth maybe), but how do you test samples demonstrating displays and lvgl for example?
Portability is already documented and required, but is not a mandatory right now. There are different levels of portability. If your understanding of portability is that it has to work and build on each platform in Zephyr, then we are basically increasing the entry barrier for writing samples and nobody will want to write samples for ~1000 platforms.
Depends on your definition of portability. If a sample is provided for platform A and documented to run on A and does not build on platform B then it is not a bug. Someone with platform B can always come in and enahance it to run on that platform.
sure.
Line 3281 in 95179b2
guidelines are actually here: https://docs.zephyrproject.org/latest/samples/sample_definition_and_criteria.html#definition-and-criteria
Why? A sample or a test that can get away without using plaform_allow is fine, platform_allow is just for the test (in the context of the sample) it does not mean this sample can't run on other platforms. What targets are supported with a specific sample should be part of the docs of the sample.
We have maintainer for samples in general, to make sure samples are consistent and provided in a way that helps users and developers. This is similar to anything else in Zephyr.
Writing samples in a generic way and considering portability is already described here: https://docs.zephyrproject.org/latest/samples/sample_definition_and_criteria.html#definition-and-criteria No need to repeat that.
???
not sure what free-style means here and why you think it is free-style now?
This is not a solution, this is just a recipe for more problems. platform_allow can be replaced or removed only where it make sense, try removing platform_allow from samples under samples/bluetooth. So unless you can provide a better way, we are stuck with this.
We have a sample are in zephyr and we have a maintainer, there is no need to create more groups.
yes, thats why we use platform_allow (which is also a filter), and if there is an issue with those, it is a bug.
if you think we do not have one already, propose one.
|
@nashif , thanks a lot for feedbacks, let me clarify my thought below.
I agree. But the simulators can not cover most of the necessary features, as many hardware are missing, And we do not see strong roadmap from any simulator's roadmap.
it is not, I agree. My proposal is more from the ego system point of view. I find several issues which related Kconfg/dts dependency with samples/basic/minimal the Kconfig dependency change can easily break the build. Which needs attention, as Zephyr-RTOS states that it is highly configurable.
Moving Samples into test is a good idea, I can add to this proposal, which there is a dependency on what the constrains are, which is better coming from the original sample designer.
The idea is that in upstream we only cares on integration_platform(by now it is called platflom_allow), the differences is that platform_allow will excluded by twister, and I want change that. As I mention above, there is no needs for original owner to maintain 100 platforms, the sample maintainer needs take care and assign issue to the platform owner, so it will not blocking the upstream releases. It helps vender to identify issues in their features, and if the vender does not care, no one cares, but the issue is identified already. In this way, a well maintained platforms will quick qualified by twister testing.
if it is not a bug. The how could we know it is broken? or we can mark it as feature enhancement issue? There is only 2 maintainer for all samples, which is not possible. ideally, each sample will have a maintainer who are from the related working group.
What I am propose is to accommodate the sample in twister CI, so that is it easy for maintainer. platform_allow or integration_platform is just a name. The idea is that downstream CI with twister can help to catch issues without change, and maybe enhance issue will be reported from each vender. Also, any developer can find this issue with CI, and provide fixes with twister's CI this could be much more easier.
This could be different, Samples are always include several modules/ firmware, e.g. we have sensor working group, who need to know the peripheral driver, and the sensor fw/algorithm. but sensor team may only care sensor, what about motor control? and all others?
I just want to add 1 requirement for constrains, i.e, what is the constrains on particular sample.
As we only test with platform_allow, so we will not see porting issue. And people try to port this will have to resolve issues by themselves, and submit PR. this proposal is just to make this process easier.
Sorry, forgive my poor language, may be limited supported status would be better.
I agree. maybe we can state that platform_allow is not recommend, and try to use dts/Kconfig first.
I suppose the sample owner is too few, suggest to break-down the samples and adding more specific maintainer.
as above, just add one statement on constrains for porting. |
I said, "where applicable".
The thing is, such samples are not there to be run on platforms, they actually are designed to build only and to exercise and show how to optimize for footprint and it is done with a selected set of platforms for demonstration purposes only. There is no requirement or expectation that any platform should be usable or configurable to operate for example without multithreading. When you remove filters and samples start failing, that is not an automatic bug.
I am not suggesting we should move samples to be tests. I am saying the investment in testing how a sample for subsystem X works should be better done in the test framework in general to cover unit tests and functional tests of the feature, samples can benefit from that down the line, but our goal should not be how to validate complex samples from the get go.
You can only change that by following the sample guidelines, if you want to remove platform_allow, you should apply another filter that is more flexible, just removing platform_allow is going to be a problem.
As I said a above, samples can always be exteded in features to support new additional platforms, this should be done by the platform owner, not the sample owner. If you platform does not work with a sample, it is not a bug, it is a bug if the sample documents supporting a platform A that does not work.
Those are the maintainers for the samples as a subsystem or area, i.e. how we structure samples, how we write them, what the expectation and how do we make sure our samples are useful, each subsystem or area of the project owns their own specific samples, just search for |
I agree that the purpose if the sample is not to run on platforms or even build on possible platform. but as it is in basic folder, should we think about why not it can't be? maybe this is not a bug, but a feature enhancement.
I see. and agree.
OK, I see, maybe should put platform_allow as less preferred.
the things is I want twister CI can catch such issue without addition efforts. this helps a lot for our downstream alignment with upstream. |
There is a point in @hakehuang RFC that is important and that is the use of "platform_allow". I personally believe this filter keyword should be removed. The filters associated with the sample/test yamls should stick to only DTS/Kconfig type capabilities of the platform as the indicator of whether this application should be able to compile/run on the target. @nashif you make a valid argument that not all samples/tests are designed to be able to build or run on arbitrary targets but there seems to be a cheat going on to use platform_allow as a method to filter. When I see the list of failures that Hake identified with the basic\minimal sample I wonder what dts/configuration is missing and why that isn't part of the filter to this sample? I've seen other samples/tests where we end up with this hugely growing list of allowed platforms which just doesn't scale very well. |
Introduction
Samples in Zephyr tree have been a very critical code reference for Zephyr RTOS. the basic sample concepts are defined here:
[samples definition
Goal of samples need to be more clear as to:
Problem description
platform_allow
without any clear reason on this.The bottom line here is:
Concerns with above bottom line are
Proposed change
platform_allow
, instead that dts/Kconfig/feature tag is recommend.integration_platforms
to sample is a MUST, and CI in upstream will only build for those platforms. And board testing from upstream can focus onintegration_platforms
. integration_platform shall not keep adding if there is no significant differences.Detailed RFC
platform_allow
is less acceptable, using dts/Kconfig/tag is the recommend way by now, and open to future change.portability
for issues found in the future as enhancement issue.Proposed change (Detailed)
proposed PRs for such as below:
#84458
#85446
Dependencies
not clear
Concerns and Unresolved Questions
Need feedback
Alternatives
we can keep Sample as it is now, but the defects are lists above as concerns.
The text was updated successfully, but these errors were encountered: