-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Introduction
In the latest Sensor WG Meeting (240819), it was discussed the current state of sensor testing and there was interest in improving this to make it more effective without implying a significant effort.
In the context of migrating Sensor drivers to the Sensor model V2 (Asynchronous, Read/Decode APIs) it becomes more important to have a solution in place to keep track of regressions, as well as validate the porting process along the way.
Problem description
Currently, there are two main approaches for testing sensor drivers:
- Build-all sensors Testsuite -> https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/build_all/sensor
- Sensor Emulator Test-suites -> https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/sensor
The issues with only relying on these two approaches:
- Build-all sensors:
- Build-time only verification (for sensors with no emulator).
- Sensor Emulator Test-suites
- Requires developing and maintaining an emulator + test-suite per sensor driver (non-negligible effort).
- Limited number of emulators in-tree (and
allmost of them are based on Sensor model v1 -> Fetch/Get approach). - There have been bugs identified for some of the emulators themselves.
In general, there are challenges with the existing :
- We've identified some issues not covered by none of the above. Some examples:
- The existing testing infrastructure does not cover Read-Stream/Decode APIs nor triggers (or at least not in a significant way).
- The rate at which users contribute new sensors is very high (+10 PRs introducing new drivers at this moment).
Proposed change
HIL Testing Infrastructure in CI
Incorporate HIL sensor testing infrastructure in CI, in which run-time sensor operations are performed and verified. This implies test-beds provided by vendors and trusted community members are deployed and maintained operational.
To achieve this, we'd need to:
- Coordinate with the Testing WG and understand what options we have.
- Contact Sensor Vendors and trusted community members to provide and maintain a test-bed with supported sensors.
- Start deploying and adding test-beds nodes in CI infrastructure.
Testing Approach
- Go with generic tests (akin the existing generic sensor samples??) that is applicable to all sensors that support that type.
- Evaluate the following parameters
- Sensor Polling (read/decode with results validation)
- Attributes (e.g: change ODR or resolution and verify it is effective)
- Triggers (to the extend that is possible in a static setup, e.g: Watermark, Stationary, FIFO Full).
- Preferrably, evaluate the sensor on all supported transports (e.g: BME280 both SPI and I2C).
Concerns and Unresolved Questions
- Having enough vendors and community members to provide testing setup.
- Whether we use the Sensor Shell for this or stick to the aforementioned generic testsuites.
Alternatives
Not doing any change in sensor testing and keep on catching bugs as people report them.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status
Status