Skip to content

Improve test coverage#24

Open
ohtaman wants to merge 3 commits into
mainfrom
feature/improve-test-coverage
Open

Improve test coverage#24
ohtaman wants to merge 3 commits into
mainfrom
feature/improve-test-coverage

Conversation

@ohtaman
Copy link
Copy Markdown
Owner

@ohtaman ohtaman commented Jan 14, 2025

Changes

Added comprehensive test coverage for core functionality:

  • Port binding error handling and retry mechanism
  • Process error handling in run_streamlit
  • Network error and retry mechanism in wait_for_server
  • Error handling in start_desktop_app for various failure scenarios

Coverage Improvements

  • core.py: 80% → 98%
  • Overall: 81% → 89%

Test Additions

Added 8 new test cases:

  1. test_find_free_port_retry
  2. test_find_free_port_failure
  3. test_run_streamlit_error
  4. test_wait_for_server_retry_success
  5. test_wait_for_server_network_error
  6. test_start_desktop_app_port_error
  7. test_start_desktop_app_server_error
  8. test_start_desktop_app_webview_error

Resolves #19

- Add custom exception hierarchy for better error handling
- Implement retry mechanisms for network connectivity and port binding
- Add graceful process termination with fallback force kill
- Add detailed logging and error messages
- Improve documentation with clear error scenarios

Fixes #18
- Fix process termination to use single join call
- Fix wait_for_server timeout handling
- Fix test by properly mocking time.time()
- Add test cases for port binding error and retry mechanism
- Add test for process error handling in run_streamlit
- Add test for network error and retry in wait_for_server
- Add comprehensive error handling tests for start_desktop_app
- Increase core.py coverage from 80% to 98%
- Increase overall coverage from 81% to 89%

Resolves #19
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.

Improve test coverage and test infrastructure

1 participant