Skip to content

Conversation

JarmouniA
Copy link
Contributor

@JarmouniA JarmouniA commented Aug 17, 2025

Make tests/samples test scenarios depend on the existence of required DT elements (aliases, "zephyr,user" properties...).

Motivation behind the filtering changes:
The number of board overlays in ADC tests/samples is completely out of control in my opinion. And the reason is: most of their test scenarios get triggered, & fail every single time a board PR is opened and has the adc tag in [board].yaml (& almost always it does because most people assume those tags are a general list of supported features..., not test dedicated), then an overlay is added, as a fix for CI, eventhough the exact ADC IP/driver is already tested elsewhere on many boards.

@JarmouniA JarmouniA force-pushed the fix_adc_api_test_filter branch 2 times, most recently from fee055b to 60289a3 Compare August 17, 2025 14:32
@JarmouniA JarmouniA marked this pull request as ready for review August 17, 2025 15:37
@zephyrbot zephyrbot added area: ADC Analog-to-Digital Converter (ADC) area: Samples Samples platform: NXP NXP platform: GD32 GigaDevice platform: Renesas RA Renesas Electronics Corporation, RA labels Aug 17, 2025
@JarmouniA JarmouniA force-pushed the fix_adc_api_test_filter branch from 60289a3 to c046f0e Compare August 19, 2025 07:25
@zephyrbot zephyrbot added the area: Twister Twister label Aug 19, 2025
@JarmouniA JarmouniA force-pushed the fix_adc_api_test_filter branch 2 times, most recently from 5df6649 to bcb7286 Compare August 19, 2025 21:31
@butok
Copy link
Contributor

butok commented Sep 11, 2025

Remove the overlays of redundant platforms that are testing the same IP/Driver, and only keep 1 platform from each SoC series.

@JarmouniA Please clarify.
Does it mean that building of the samples/tests for the "redundant" platforms will be failed?

@JarmouniA
Copy link
Contributor Author

Remove the overlays of redundant platforms that are testing the same IP/Driver, and only keep 1 platform from each SoC series.

@JarmouniA Please clarify. Does it mean that building of the samples/tests for the "redundant" platforms will be failed?

If you mean in CI, they won't be built anymore because of the filtering in test conf yaml file.

return True
return False
elif ast[0] == "dt_node_has_prop":
# 1st arg 'label' must be a valid node alias or a node path
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be nice to rename dt_node_prop_enabled into dt_nodelabel_prop_enabled to clarify that its 1st argument is a label. There's only 1 place where it's used (samples/boards/nxp/mimxrt1170_evk_cm7/magic_addr/sample.yaml).
It would make your added dt_node_has_prop clearer that its 1st arg is a node path/alias.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a follow-up PR where I will document the different expressions as well.

@butok
Copy link
Contributor

butok commented Sep 16, 2025

Remove the overlays of redundant platforms that are testing the same IP/Driver, and only keep 1 platform from each SoC series.

@JarmouniA Please clarify. Does it mean that building of the samples/tests for the "redundant" platforms will be failed?

If you mean in CI, they won't be built anymore because of the filtering in test conf yaml file.

Not just CI.
Since this PR removes many platform overlays, the "west build" for removed platforms is not possible for these samples.

@JarmouniA
Copy link
Contributor Author

JarmouniA commented Sep 19, 2025

If you mean in CI, they won't be built anymore because of the filtering in test conf yaml file.

Not just CI. Since this PR removes many platform overlays, the "west build" for removed platforms is not possible for these samples.

So here is how I see it, putting CI aside, samples are for demonstration purposes. In the case of ADC, the utility of an overlay/conf is to show a user how to configure a certain ADC IP/driver for a certain usecase. Hence, having 1 overlay/conf per IP/driver per usecase is sufficient in my opinion to fulfill this aim. There is absolutely no added value whatsoever in having 10s of overlays/confs for the same ADC IP/driver with different boards.

Having said that, I think I will leave the overlays/confs clean up for another PR and focus on enhancing test scenarios filtering/selection in this one in order to get this merged sooner.

@butok
Copy link
Contributor

butok commented Sep 25, 2025

There is absolutely no added value whatsoever in having 10s of overlays/confs for the same ADC IP/driver with different boards.

The added value is that the samples/tests work out of the box for these boards.

@JarmouniA
Copy link
Contributor Author

There is absolutely no added value whatsoever in having 10s of overlays/confs for the same ADC IP/driver with different boards.

The added value is that the samples/tests work out of the box for these boards.

Following this logic, you would be fine with having 847 (number of supported boards rn) overlay/conf files in each sample? Or let's say just the ADC sample (assuming all Zephyr supported boards have an ADC)?

@JarmouniA
Copy link
Contributor Author

There is absolutely no added value whatsoever in having 10s of overlays/confs for the same ADC IP/driver with different boards.

The added value is that the samples/tests work out of the box for these boards.

Tests are a completely different matter than samples in my opinion, they are not supposed to build/run on any board, that makes no sense, they are not demos, rather they should build/run only one targets used on vendor test benches and Zephyr Project CI, and the selection of those targets should be based on well defined criterias like:

  • maximizing coverage of SoCs, IPs/drivers/subsystems...,
  • avoiding redundancy in coverage,
  • using the most performant target to test a certain IP to cut test time....

@butok
Copy link
Contributor

butok commented Oct 1, 2025

There is absolutely no added value whatsoever in having 10s of overlays/confs for the same ADC IP/driver with different boards.

The added value is that the samples/tests work out of the box for these boards.

Tests are a completely different matter than samples in my opinion, they are not supposed to build/run on any board, that makes no sense, they are not demos, rather they should build/run only one targets used on vendor test benches and Zephyr Project CI, and the selection of those targets should be based on well defined criterias like:

  • maximizing coverage of SoCs, IPs/drivers/subsystems...,
  • avoiding redundancy in coverage,
  • using the most performant target to test a certain IP to cut test time....

Hi @hakehuang
Is there any statement from the Zephyr Testing group regarding the twister scope limitation?

@hakehuang
Copy link
Contributor

Is there any statement from the Zephyr Testing group regarding the twister scope limitation?

we do not have aligned agreement on this yet. I would say for now the module owner can make the judgement .

@JarmouniA JarmouniA force-pushed the fix_adc_api_test_filter branch from a425e78 to 80e5aa1 Compare October 4, 2025 10:11
@zephyrbot zephyrbot added area: Boards/SoCs area: Tests Issues related to a particular existing or missing test platform: NXP MCU labels Oct 4, 2025
Add 'dt_node_has_prop' expression to use the existence of a node property
as a filter in Twister test configuration yaml files.
First argument must be a node alias (in aliases node) or a node path,
not a nodelabel.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Make ADC tests' test scenarios depend on the existence of
required DT elements.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Make ADC samples' test scenarios depend on the existence of
required DT elements.

Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
@JarmouniA JarmouniA force-pushed the fix_adc_api_test_filter branch from 80e5aa1 to efacc1d Compare October 4, 2025 10:31
Copy link

sonarqubecloud bot commented Oct 4, 2025

@JarmouniA
Copy link
Contributor Author

JarmouniA commented Oct 4, 2025

Update: postponed the clean-up of platform_allow, overlays/confs, integration_platforms... until there is consensus on the topic.

@JarmouniA
Copy link
Contributor Author

@butok @anangl Could you please have a look? Thanks!

Comment on lines +284 to +287
# 1st arg 'label' must be a valid node alias or a node path
label = ast[1][0]
try:
node = edt.get_node(label)
Copy link
Member

Choose a reason for hiding this comment

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

Why not name this variable path (as the get_node() parameter is named)? label is a bit confusing.

Copy link
Contributor Author

@JarmouniA JarmouniA Oct 7, 2025

Choose a reason for hiding this comment

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

It can be an alias too, but I agree it's confusing, will recheck in a follow-up PR to document these expressions and address #94585 (comment)

@JarmouniA JarmouniA added this to the v4.3.0 milestone Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Boards/SoCs area: Samples Samples area: Tests Issues related to a particular existing or missing test area: Twister Twister platform: GD32 GigaDevice platform: NXP MCU platform: NXP NXP platform: Renesas RA Renesas Electronics Corporation, RA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants