Skip to content

feat: Add group class for better control of multi dut tests#415

Open
lucasssvaz wants to merge 2 commits intoespressif:mainfrom
lucasssvaz:feat/group
Open

feat: Add group class for better control of multi dut tests#415
lucasssvaz wants to merge 2 commits intoespressif:mainfrom
lucasssvaz:feat/group

Conversation

@lucasssvaz
Copy link
Copy Markdown
Member

Description

This pull request introduces multi-DUT (Device Under Test) synchronization support to the pytest-embedded framework, allowing users to control and coordinate multiple DUTs in parallel within tests. The main addition is the new DutGroup class, 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

  • Added the DutGroup class in pytest_embedded/group.py, providing a container-like proxy to run any Dut method in parallel across multiple DUTs. Special handling is included for expect and expect_exact to support both broadcast and per-DUT patterns, as well as container protocol support (indexing, iteration, etc.). (pytest-embedded/pytest_embedded/group.py)
  • Exposed DutGroup in the main package API and as a class attribute on Dut for discoverability. (pytest-embedded/pytest_embedded/__init__.py, pytest-embedded/pytest_embedded/dut.py) [1] [2] [3]

Documentation Updates

  • Added a new API documentation section for pytest_embedded.group and updated usage documentation to explain multi-DUT synchronization, how to use DutGroup, and its benefits for parallel test execution. (docs/apis/pytest-embedded.rst, docs/usages/expecting.rst) [1] [2] [3]

Testing

  • Introduced comprehensive tests for DutGroup covering 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-embedded for scenarios involving multiple devices, making it easier to write robust, synchronized, and efficient multi-device tests.

Testing

Tested locally

@github-actions
Copy link
Copy Markdown

Title Coverage Tests Skipped Failures Errors Time
3.10 ARM64 Coverage 104 18 💤 1 ❌ 0 🔥 10m 48s ⏱️
Qemu Coverage 7 0 💤 0 ❌ 0 🔥 25.134s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant