ci(tests): Add support for multiple duts#12063
Conversation
👋 Hello lucasssvaz, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results111 files 111 suites 32m 57s ⏱️ For more details on these errors, see this check. Results for commit 4ad400f. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2f7ee0b to
38b9808
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive support for multi-device testing in the CI infrastructure, enabling tests that require communication between multiple ESP32 devices (e.g., WiFi AP/client, BLE server/client). The changes introduce detection, building, and running capabilities for multi-device tests while maintaining backward compatibility with single-device tests.
Key Changes
- Added multi-device test infrastructure with functions to detect, build, and run tests requiring multiple devices
- Implemented two example multi-device test suites: WiFi AP/client and BLE server/client communication tests
- Enhanced documentation with comprehensive guide for creating, building, and running multi-device tests
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
tests/validation/wifi_ap/test_wifi_ap.py |
Python test orchestrating WiFi AP and client communication |
tests/validation/wifi_ap/ap/ap.ino |
Arduino sketch for WiFi Access Point device |
tests/validation/wifi_ap/client/client.ino |
Arduino sketch for WiFi client device |
tests/validation/wifi_ap/ci.yml |
Configuration defining multi-device setup and platform support |
tests/validation/ble/test_ble.py |
Python test coordinating BLE server/client pairing and secure communication |
tests/validation/ble/server/server.ino |
BLE server sketch with secure characteristic support |
tests/validation/ble/client/client.ino |
BLE client sketch with service discovery and authentication |
tests/validation/ble/ci.yml |
BLE test configuration with multi-device specification |
tests/conftest.py |
Added helper functions for IP validation and random string generation |
.github/scripts/tests_run.sh |
Enhanced with multi-device test detection, port management, and execution logic |
.github/scripts/tests_build.sh |
Updated with multi-device build functions and custom build directory handling |
.github/scripts/sketch_utils.sh |
Modified sketch counting to skip multi-device test sketches |
docs/en/contributing.rst |
Comprehensive documentation for creating and running multi-device tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
38b9808 to
0bea36f
Compare
0bea36f to
7636983
Compare
|
LGTM, but please use the new WiFi APIs from now on |
Ok. I created it based in some examples we have in our core. We need to update them and deprecate the old API. |
88793f3 to
4df441c
Compare
4df441c to
815bd1b
Compare
005b638 to
a5baeae
Compare
|
Description of Change
This pull request adds robust support for multi-device tests in the CI build and run scripts. The changes introduce new functions for detecting, building, and running multi-device tests, and ensure that these tests are handled separately from regular single-device tests. The updates also improve argument handling, error reporting, and test selection logic for both build and run workflows.
Multi-device test support:
is_multi_device_testfunctions to both.github/scripts/tests_build.shand.github/scripts/tests_run.shto detect tests configured for multiple devices viamulti_deviceinci.yml. [1] [2]build_multi_device_sketchandbuild_multi_device_testfunctions intests_build.shto build all required device sketches for multi-device tests, using custom build directories and handling errors per device.run_multi_device_testfunction intests_run.shto run multi-device tests with proper argument construction, port assignment, and result aggregation, including retries and platform checks.Build and run workflow changes:
General improvements and bug fixes:
count_sketchesinsketch_utils.shto skip sketches that are part of multi-device tests, preventing duplicate builds.Test Scenarios
Tested locally
Related links
Requires espressif/pytest-embedded#393