feat: Add group class for better control of multi dut tests#415
Open
lucasssvaz wants to merge 2 commits intoespressif:mainfrom
Open
feat: Add group class for better control of multi dut tests#415lucasssvaz wants to merge 2 commits intoespressif:mainfrom
lucasssvaz wants to merge 2 commits intoespressif:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces multi-DUT (Device Under Test) synchronization support to the
pytest-embeddedframework, allowing users to control and coordinate multiple DUTs in parallel within tests. The main addition is the newDutGroupclass, which provides a transparent, parallel proxy for running commands and assertions across multiple DUTs. The documentation and tests have been updated to reflect and validate this new functionality.Key changes:
Multi-DUT Synchronization Feature
DutGroupclass inpytest_embedded/group.py, providing a container-like proxy to run anyDutmethod in parallel across multiple DUTs. Special handling is included forexpectandexpect_exactto support both broadcast and per-DUT patterns, as well as container protocol support (indexing, iteration, etc.). (pytest-embedded/pytest_embedded/group.py)DutGroupin the main package API and as a class attribute onDutfor discoverability. (pytest-embedded/pytest_embedded/__init__.py,pytest-embedded/pytest_embedded/dut.py) [1] [2] [3]Documentation Updates
pytest_embedded.groupand updated usage documentation to explain multi-DUT synchronization, how to useDutGroup, and its benefits for parallel test execution. (docs/apis/pytest-embedded.rst,docs/usages/expecting.rst) [1] [2] [3]Testing
DutGroupcovering container protocol, parallel execution, broadcasting, per-DUT patterns, proxying, multi-phase synchronization, and error handling. (pytest-embedded/tests/test_base.py)These changes significantly enhance the usability of
pytest-embeddedfor scenarios involving multiple devices, making it easier to write robust, synchronized, and efficient multi-device tests.Testing
Tested locally