-
Notifications
You must be signed in to change notification settings - Fork 109
Tests: Add Waiter
#579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: Add Waiter
#579
Conversation
Reviewer's Guide by SourceryThis pull request introduces a No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #579 +/- ##
==========================================
+ Coverage 78.89% 78.97% +0.08%
==========================================
Files 23 24 +1
Lines 1938 1979 +41
Branches 291 294 +3
==========================================
+ Hits 1529 1563 +34
- Misses 284 291 +7
Partials 125 125 ☔ View full report in Codecov by Sentry. |
why: Tests need a reliable way to wait for pane content, especially with different shells what: - Add PaneWaiter class with wait_for_content, wait_for_prompt, wait_for_text methods - Add WaitResult class to handle success/failure/error states - Add comprehensive test suite for waiter functionality
- Fix error propagation in wait_for_content to properly handle timeouts - Add proper type hints and fix mypy errors - Use custom exceptions instead of generic ones in tests - Fix code formatting and line length issues - Update test assertions to match actual error handling
Inspired by Playwright/Selenium/boto3's waiter.
Changes
feat(test): Add PaneWaiter utility for waiting on pane content
why: Tests need a reliable way to wait for pane content, especially with different shells
what:
Summary by Sourcery
Adds a
PaneWaiter
utility class for waiting on tmux pane content in tests. This class provides methods for waiting for specific content, prompts, or text within a tmux pane, along with aWaitResult
class to handle the outcome of these operations. It also includes a comprehensive test suite.New Features:
PaneWaiter
class to facilitate waiting for specific content, prompts, or text within a tmux pane during tests, enhancing test reliability, especially when dealing with asynchronous shell operations.WaitResult
class to encapsulate the outcome of wait operations, providing details on success, the resulting value, or any errors encountered.Tests:
PaneWaiter
utility, covering scenarios such as waiting for prompts, specific text, handling timeouts, custom error messages, and custom content predicates.Test plan