Skip to content

tests: posix: add one integration platform per suite #86634

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

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Mar 4, 2025

Add one integration platform per testsuite to reduce the number of issues reported by the qa log level introduced in #86571.

Closes #86633

Before:

INFO    - Using Ninja..
INFO    - Zephyr version: v4.1.0-rc3-8-gf3c3c2cf7886
INFO    - Using 'zephyr' toolchain.
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs.minimal
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs.newlib
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs.tls
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs.tls.newlib
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs.picolibc
QA      - filter with no integration platforms in tests/posix/fs/portability.posix.fs.tls.picolibc
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/fs: 7
QA      - filter with no integration platforms in tests/posix/c_lib_ext/portability.posix.c_lib_ext
QA      - filter with no integration platforms in tests/posix/c_lib_ext/portability.posix.c_lib_ext.armclang_std_libc
QA      - filter with no integration platforms in tests/posix/c_lib_ext/portability.posix.c_lib_ext.arcmwdtlib
QA      - filter with no integration platforms in tests/posix/c_lib_ext/portability.posix.c_lib_ext.minimal
QA      - filter with no integration platforms in tests/posix/c_lib_ext/portability.posix.c_lib_ext.newlib
QA      - filter with no integration platforms in tests/posix/c_lib_ext/portability.posix.c_lib_ext.picolibc
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/c_lib_ext: 6
QA      - filter with no integration platforms in tests/posix/spinlocks/portability.posix.spinlocks
QA      - filter with no integration platforms in tests/posix/spinlocks/portability.posix.spinlocks.minimal
QA      - filter with no integration platforms in tests/posix/spinlocks/portability.posix.spinlocks.newlib
QA      - filter with no integration platforms in tests/posix/spinlocks/portability.posix.spinlocks.picolibc
QA      - filter with no integration platforms in tests/posix/spinlocks/portability.posix.spinlocks.no_spin_validate
QA      - filter with no integration platforms in tests/posix/barriers/portability.posix.barriers
QA      - filter with no integration platforms in tests/posix/barriers/portability.posix.barriers.minimal
QA      - filter with no integration platforms in tests/posix/barriers/portability.posix.barriers.newlib
QA      - filter with no integration platforms in tests/posix/barriers/portability.posix.barriers.picolibc
QA      - filter with no integration platforms in tests/posix/eventfd/portability.posix.eventfd
QA      - filter with no integration platforms in tests/posix/eventfd/portability.posix.eventfd.minimal
QA      - filter with no integration platforms in tests/posix/eventfd/portability.posix.eventfd.newlib
QA      - filter with no integration platforms in tests/posix/eventfd/portability.posix.eventfd.armclang_std_libc
QA      - filter with no integration platforms in tests/posix/eventfd/portability.posix.eventfd.arcmwdtlib
QA      - filter with no integration platforms in tests/posix/eventfd/portability.posix.eventfd.picolibc
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/eventfd: 6
QA      - filter with no integration platforms in tests/posix/xsi_realtime/portability.posix.xsi_realtime
QA      - filter with no integration platforms in tests/posix/xsi_realtime/portability.posix.xsi_realtime.minimal
QA      - filter with no integration platforms in tests/posix/xsi_realtime/portability.posix.xsi_realtime.newlib
QA      - filter with no integration platforms in tests/posix/xsi_realtime/portability.posix.xsi_realtime.picolibc
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.with_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.without_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.minimal.with_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.minimal.without_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.picolibc.with_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.picolibc.without_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.newlib.with_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.newlib.without_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.arcmwdtlib.with_posix_api
QA      - filter with no integration platforms in tests/posix/headers/portability.posix.headers.arcmwdtlib.without_posix_api
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/headers: 10
QA      - filter with no integration platforms in tests/posix/rwlocks/portability.posix.rwlocks
QA      - filter with no integration platforms in tests/posix/rwlocks/portability.posix.rwlocks.minimal
QA      - filter with no integration platforms in tests/posix/rwlocks/portability.posix.rwlocks.newlib
QA      - filter with no integration platforms in tests/posix/rwlocks/portability.posix.rwlocks.picolibc
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.minimal
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.newlib
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.armclang_std_libc
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.arcmwdtlib
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.tls
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.tls.newlib
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.picolibc
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.no_spin_validate
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.signal.strsignal_no_desc
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.signal.big_nsig
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.dynamic_stack
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.static_stack
QA      - filter with no integration platforms in tests/posix/common/portability.posix.common.userspace
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/common: 14
QA      - filter with no integration platforms in tests/posix/threads_ext/portability.posix.threads_ext
QA      - filter with no integration platforms in tests/posix/threads_ext/portability.posix.threads_ext.minimal
QA      - filter with no integration platforms in tests/posix/threads_ext/portability.posix.threads_ext.newlib
QA      - filter with no integration platforms in tests/posix/threads_ext/portability.posix.threads_ext.picolibc
QA      - filter with no integration platforms in tests/posix/signals/portability.posix.signals
QA      - filter with no integration platforms in tests/posix/signals/portability.posix.signals.minimal
QA      - filter with no integration platforms in tests/posix/signals/portability.posix.signals.newlib
QA      - filter with no integration platforms in tests/posix/signals/portability.posix.signals.picolibc
QA      - filter with no integration platforms in tests/posix/signals/portability.posix.signals.strginal_no_desc
QA      - filter with no integration platforms in tests/posix/signals/portability.posix.signals.big_nsig
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/signals: 6
QA      - filter with no integration platforms in tests/posix/timers/portability.posix.timers
QA      - filter with no integration platforms in tests/posix/timers/portability.posix.timers.minimal
QA      - filter with no integration platforms in tests/posix/timers/portability.posix.timers.newlib
QA      - filter with no integration platforms in tests/posix/timers/portability.posix.timers.picolibc
QA      - filter with no integration platforms in tests/posix/xsi_system_logging/portability.xsi.system.logging
QA      - filter with no integration platforms in tests/posix/xsi_system_logging/portability.xsi.system.logging.minimal
QA      - filter with no integration platforms in tests/posix/xsi_system_logging/portability.xsi.system.logging.newlib
QA      - filter with no integration platforms in tests/posix/xsi_system_logging/portability.xsi.system.logging.picolibc
QA      - filter with no integration platforms in tests/posix/xsi_threads_ext/portability.posix.xsi_threads_ext
QA      - filter with no integration platforms in tests/posix/xsi_threads_ext/portability.posix.xsi_threads_ext.minimal
QA      - filter with no integration platforms in tests/posix/xsi_threads_ext/portability.posix.xsi_threads_ext.newlib
QA      - filter with no integration platforms in tests/posix/xsi_threads_ext/portability.posix.xsi_threads_ext.picolibc
QA      - filter with no integration platforms in tests/posix/xsi_threads_ext/portability.posix.xsi_threads_ext.static_stack
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/net: 6
QA      - filter with no integration platforms in tests/posix/semaphores/portability.posix.semaphores
QA      - filter with no integration platforms in tests/posix/semaphores/portability.posix.semaphores.minimal
QA      - filter with no integration platforms in tests/posix/semaphores/portability.posix.semaphores.newlib
QA      - filter with no integration platforms in tests/posix/semaphores/portability.posix.semaphores.picolibc
QA      - filter with no integration platforms in tests/posix/single_process/portability.posix.single_process
QA      - filter with no integration platforms in tests/posix/single_process/portability.posix.single_process.armclang_std_libc
QA      - filter with no integration platforms in tests/posix/single_process/portability.posix.single_process.arcmwdtlib
QA      - filter with no integration platforms in tests/posix/single_process/portability.posix.single_process.minimal
QA      - filter with no integration platforms in tests/posix/single_process/portability.posix.single_process.newlib
QA      - filter with no integration platforms in tests/posix/single_process/portability.posix.single_process.picolibc
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/single_process: 6
QA      - filter with no integration platforms in tests/posix/xsi_streams/portability.posix.xsi_streams
QA      - filter with no integration platforms in tests/posix/xsi_streams/portability.posix.xsi_streams.minimal
QA      - filter with no integration platforms in tests/posix/xsi_streams/portability.posix.xsi_streams.newlib
QA      - filter with no integration platforms in tests/posix/xsi_streams/portability.posix.xsi_streams.picolibc
INFO    - Selecting default platforms per testsuite scenario
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/ubuntu/tt-zephyr-platforms-work/zephyr/twister-out/testplan.json
INFO    - Completed in 1.5165433883666992 seconds

After:

INFO    - Using Ninja..
INFO    - Zephyr version: v4.1.0-rc3-33-g70554e297783
INFO    - Using 'zephyr' toolchain.
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/fs: 7
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/c_lib_ext: 6
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/eventfd: 6
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/headers: 10
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/common: 14
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/signals: 6
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/net: 6
QA      - Too many scenarios in /home/ubuntu/tt-zephyr-platforms-work/zephyr/tests/posix/single_process: 6
INFO    - Selecting default platforms per testsuite scenario
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/ubuntu/tt-zephyr-platforms-work/zephyr/twister-out/testplan.json
INFO    - Completed in 1.3140325546264648 seconds

Add one integration platform per testsuite to reduce the number
of issues reported by the qa log level introduced in zephyrproject-rtos#86571.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
@cfriedt cfriedt requested a review from nashif March 4, 2025 18:38
Comment on lines 6 to +10
platform_key:
- arch
- simulation
integration_platforms:
- qemu_x86
Copy link
Member Author

@cfriedt cfriedt Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing that I wasn't totally sure about, is whether there is a conflict between platform_key permutations and integration_platforms.

Ideally, we would want one tier0 per supported platform across all supported libc's (which are currently separate test scenarios). Does integration_platforms restrict CI to only 1 platform per test scenario?

Are tests only run on-diff for integration_platforms and then all tests run weekly?

I just want to avoid regressions, if at all possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side, note, the common testsuite will eventually be completely separated to smaller testsuites. There are quite a few Just blocked on #83386 for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration_platforms are used when twister is called with --integration/-G. Currently, this is done only with on-pr trigger and not always, depending on the scope of the changes, but can change in near future. E.g. maybe samples will always use -G. This is being discussed currently in the context of test strategy for Zephyr. I believe at least once per day (e.g. nightly) there will be a run with a scope broader than just integration_platforms.

There is no hard limit in twister, but the idea is to restrict the list to a minimal viable scope. If there are key differences between boards affecting a test then it might be worth having more than a 1. In most cases 1 should be enough.

platform_key works as a filter: after a single tests falling under the key parameters is done all other tests falling under the same key should be skipped. I guess having two integration_platforms falling under the same key parameters with a platform_key filter would be a problem, since the second one would get skipped and twister would complain, that skipping mustn't happen on integration_platforms. I don't think it should cause other problems.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, this is done only with on-pr trigger and not always, depending on the scope of the changes, but can change in near future. E.g. maybe samples will always use -G. This is being discussed currently in the context of test strategy for Zephyr. I believe at least once per day (e.g. nightly) there will be a run with a scope broader than just integration_platforms.

That's what I suspected.

In this case, I don't think it's wise to restrict integration tests to only 1 board, because only testing a subset of architectures against a subset of C libraries has historically been where regressions have occurred in POSIX and I will close this PR.

platform_key works as a filter: after a single tests falling under the key parameters is done all other tests falling under the same key should be skipped. I guess having two integration_platforms falling under the same key parameters with a platform_key filter would be a problem, since the second one would get skipped and twister would complain, that skipping mustn't happen on integration_platforms. I don't think it should cause other problems.

Also what I suspected.

In that case, I would consider the output of -ll qa mentioned in the linked issue to be a false positive, and I'll close this PR, as it would undoubtedly invite regressions in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that a single platform in integration scope is not enough to catch majority of regressions that can be introduced in a PR related to C libraries?

If so please consider this approach to testing (that we might adapt as our strategy):
We have limited resources (ci time = money) so we have to be efficient with our testing. To achieve this we can do testing at multiple levels with different scope:
On-PR: the most frequent trigger, hence the most optimized testing. Running only a subset of configurations (e.g. only on few integration platforms) can already cover ~80% (arbitrary number) of possible failures. We accept the risk at this stage
on-main/nightly: several times day/once a day. Broader scope, e.g. all "default_platforms" (i.e. multiple sim/emulators). With this we cover these extra %. When a regression is detected the release team makes a decision: quarantine/wait for hotfix/revert.

If ~80% of coverage cannot be achieved with a few platforms, let's add more to integration_platforms to get this 80% (integration_platforms doesn't have to be limited to just 1 platform).

As for the QA output:
It highlight that these tests relays on filter (e.g. filter: not CONFIG_NATIVE_LIBC). filter requires to run a cmake stage before twister can decide if a given platform should be skipped or not. So if no integration_platforms is used to limit the CI choice on PR it would start with way broader scope of platforms, and for each scenario it will have to run this cmake step for all platforms (several seconds per platform+scenario intead of "no time" when strings are compared).

Having the above in mind, please reconsider re-opening the PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that a single platform in integration scope is not enough to catch majority of regressions that can be introduced in a PR related to C libraries?

That's correct. Are you surprised? POSIX touches quite a lot. Literally everything from thread stacks and MMUs to networking and IPC. As POSIX maintainer, I've seen regressions occur for just about every architecture with every C library that Zephyr supports.

If so please consider this approach to testing (that we might adapt as our strategy):

I have. Reducing the scope of CI allowed quite a few regressions through, and this continued for the better part of a year. Most regressions were found because the testing was not being done up-front, and failures were seen in nightly or weekly runs. In several cases, months worth of work was reverted as workarounds which meant that months of my time were wasted.

There really was no alternative but to increase the scope again to prevent regressions.

My current strategy is to break up the larger-scoped, less structured, legacy POSIX testsuites, into testsuites that are smaller in scope. The primary testsuites that are of concern to me are 'common' and 'fs'.

Once that is done, it should be possible to use integration platforms more effectively and narrow the scope of testing. However, that work is effectively blocked at the moment due to lack of reviews.

As for the QA output:
It highlight that these tests relays on filter (e.g. filter: not CONFIG_NATIVE_LIBC). filter requires to run a cmake stage before twister can decide if a given platform should be skipped or not. So if no integration_platforms is used to limit the CI choice on PR it would start with way broader scope of platforms, and for each scenario it will have to run this cmake step for all platforms (several seconds per platform+scenario intead of "no time" when strings are compared).

Having the above in mind, please reconsider re-opening the PR

Perhaps a subset of this PR can be integrated now. I'll have another look.

In any case, after the common and fs POSIX testsuites are split up, there should be less risk.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PerMac - I'll see what I can do here right after 4.1.0 is released.

@cfriedt
Copy link
Member Author

cfriedt commented Mar 8, 2025

Moved to #86798 due to force push while PR was closed (cannot reopen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: posix: ensure each testsuite has at least one integration platform
2 participants