-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
sanitycheck: improve fixture support and fix some bugs... #25524
sanitycheck: improve fixture support and fix some bugs... #25524
Conversation
Cleanup fixture processing and allow ztest testcases to support harness_config with fixture definition. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This test depends on additional hardware being connected to the board, add a fixture and cleanup whitelist. Fixes zephyrproject-rtos#25177 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add fixtures to hardware map schema. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
It is now possible to add a list of fixture a platform supports which is matched to testcases requesting fixtures to be avaiable to be able to run. For example: - available: true connected: true id: 0240000026334e450015400f5e0e000b4eb1000097969900 platform: frdm_k64f product: DAPLink CMSIS-DAP runner: pyocd serial: /dev/ttyACM9 fixtures: - gpio_loopback Fixes zephyrproject-rtos#24943 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
I might need to split this PR to get the medium bug in first... |
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
This test requires a fixture to be installed, in this case a wire connecting two GPIO pins. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
bfe850a
to
9f8a7d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need better documentation on exactly what the fixture is and how you enable it. doc/guides/test/sanitycheck.rst
just tells how to use it.
I infer these changes fix #25177 by keeping the sample board overrides from being built because the boards don't have the device attached. So the way to do testing requires adding the fixture to the board in the hardware yaml used for testing.
If so, that should be added to the documentation since there are no in-tree hardware yaml samples (AFAIK).
the test will still be built even if you do not have the fixture attached, with --device-testing however, if there is no fixture attached to the board and you do not specify --fixture -r have it in the hardware map, it will not be built or run. |
documentation for the HW map addition will be added, hence the DNM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -4,3 +4,6 @@ tests: | |||
depends_on: gpio | |||
min_flash: 34 | |||
filter: dt_compat_enabled("test,gpio_basic_api") | |||
harness: ztest | |||
harness_config: | |||
fixture: gpio_loopback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would deserve rewrite of the sanitycheck.rst, as it mentions things like fixture_gpio_loop, fixture_ble_fw
I prefer the one proposed in this PR indeed (w/o the 'fixture_' prefix)
This works great!
|
we should only have one fixture per testcase.
This happens because we know nothing about the shield harness, this needs to be defined as a new class in sanitycheck. Since you have fixture now, you could change this to console or ztest and use the fixture keyword for filtering. We probably need to change all those testcases that have custom harness and use fixtures instead. |
ffc279e
to
f0471b3
Compare
Sure. But then, harness definition may require an update, as it is more constrained than documented definition: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor doc tweaks.
It'd be nice if fixtures could be read from the board yaml as well as being described in the hardware device yaml. E.g. thingy52_nrf52832.yaml
has:
supported:
- i2c
- hts221
so it should be possible to also specify that fixture: i2c_hts221
is available without having to add it by hand to the hardware map file.
That's an enhancement out of scope for this PR, IMO.
f0471b3
to
3739551
Compare
doc/guides/test/sanitycheck.rst
Outdated
|
||
When running `sanitycheck` with :option:`--device-testing`, the configured fixture | ||
in the hardware map file will be matched to testcases requesting the same fixtures | ||
and these test will be executed on the boards that provide this fixture. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/test/tests/
ba9027d
to
3f68fdb
Compare
Add documentation about fixtures and how to use them in the hardware map. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
3f68fdb
to
66199af
Compare
Fixes #24943
Fixes #25177