Skip to content

Fix/hanging single dut cases breaks followup test cases#378

Merged
hfudev merged 5 commits intomainfrom
fix/hanging-single-dut-cases-breaks-followup
Oct 13, 2025
Merged

Fix/hanging single dut cases breaks followup test cases#378
hfudev merged 5 commits intomainfrom
fix/hanging-single-dut-cases-breaks-followup

Conversation

@hfudev
Copy link
Copy Markdown
Member

@hfudev hfudev commented Oct 8, 2025

No description provided.

@hfudev hfudev requested a review from Copilot October 8, 2025 14:49
@hfudev hfudev self-assigned this Oct 8, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors Unity test case execution to fix an issue where hanging single DUT (Device Under Test) cases break subsequent test cases. The changes restructure the test execution flow to better handle failures and exceptions during test case setup and execution.

Key changes:

  • Refactored test case execution from decorator-based approach to explicit method calls
  • Extracted common Unity output parsing logic into a standalone function
  • Added proper exception handling for pre-execution failures

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pytest-embedded-idf/pytest_embedded_idf/unity_tester.py Refactored Unity test execution flow with better error handling and extracted parsing logic
.pre-commit-config.yaml Updated ruff pre-commit hook version from v0.12.12 to v0.14.0

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread pytest-embedded-idf/pytest_embedded_idf/unity_tester.py
Comment thread pytest-embedded-idf/pytest_embedded_idf/unity_tester.py
Comment thread pytest-embedded-idf/pytest_embedded_idf/unity_tester.py
@hfudev hfudev requested a review from horw October 8, 2025 14:50
@igrr
Copy link
Copy Markdown
Member

igrr commented Oct 8, 2025

@hfudev is it possible to add a test case to pytest-embedded/tests/fixtures/unit_test_app_esp32/main/case_tester_example.c (for example, entering an infinite loop) and check that it's handled correctly?

@hfudev
Copy link
Copy Markdown
Member Author

hfudev commented Oct 8, 2025

@hfudev is it possible to add a test case to pytest-embedded/tests/fixtures/unit_test_app_esp32/main/case_tester_example.c (for example, entering an infinite loop) and check that it's handled correctly?

@igrr I was thinking about this too. Just not sure where to add it since the reset between each sub case will make it non-blocking. Will add test cases for sure.

@hfudev hfudev force-pushed the fix/hanging-single-dut-cases-breaks-followup branch from 31d2dc6 to 74c24e4 Compare October 10, 2025 14:44
@hfudev
Copy link
Copy Markdown
Member Author

hfudev commented Oct 10, 2025

@horw PTAL again https://github.com/espressif/pytest-embedded/compare/31d2dc6a78870873a2deee99ac9f962563d3b1e0..74c24e4eb03d9f11efdccfdaecbeb7632f060118

The test case helped me find my unimplemented fix in CaseTester. I also reported an additional bug internally (CII-3).

@igrr PTAL again.

@hfudev hfudev merged commit 4756b7f into main Oct 13, 2025
4 of 5 checks passed
@hfudev hfudev deleted the fix/hanging-single-dut-cases-breaks-followup branch October 13, 2025 11:47
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.

4 participants