OpenHands Testing: Jest & Pytest Implementation for Full-Stack Applications
The OpenHands repository demonstrates a comprehensive testing approach utilizing both Jest and Pytest frameworks for thorough unit testing coverage. With over 100 test cases, the codebase showcases modern testing practices across frontend React components and backend Python modules, ensuring robust validation of core functionalities like prompt management, UI interactions, and terminal operations. Qodo Tests Hub provides developers with an organized view into OpenHands' testing patterns, making it easier to understand how different components are tested in a real-world application. Through the hub's interactive interface, developers can explore test implementations for specific features, analyze testing strategies for both frontend and backend components, and learn practical approaches to writing effective unit tests for similar applications.
Path | Test Type | Language | Description |
---|---|---|---|
tests/unit/test_response_parsing.py |
unit
|
python | This pytest unit test verifies JSON response parsing and action handling for the OpenHands AI framework’s micro and planner agents. |
tests/unit/test_runtime_build.py |
unit
|
python | This pytest unit test verifies Docker runtime builder functionality including image creation, configuration, and build processes in OpenHands. |
tests/unit/test_security.py |
unit
|
python | This pytest unit test verifies security risk assessment and invariant analysis functionality in the OpenHands framework |
tests/unit/test_traffic_control.py |
unit
|
python | This pytest unit test verifies traffic control mechanisms in the AgentController including iteration limits, budget constraints, and headless mode operation. |
tests/unit/test_truncation.py |
unit
|
python | This pytest unit test verifies conversation history truncation and state management in the OpenHands AI agent controller. |
frontend/__tests__/services/auth.test.ts |
unit
|
typescript | This Vitest unit test verifies authentication token retrieval and storage operations in the frontend authentication service. |
frontend/__tests__/utils/extract-next-page-from-link.test.ts |
unit
|
typescript | This Vitest unit test verifies the extraction of next page numbers from GitHub API pagination link headers. |
frontend/__tests__/hooks/use-rate.test.ts |
unit
|
typescript | This Jest unit test verifies the useRate React hook’s rate calculation and threshold monitoring functionality. |
tests/runtime/test_ipython.py |
unit
|
python | This pytest unit test verifies IPython integration and file operations within the EventStreamRuntime sandbox environment. |
tests/runtime/test_stress_remote_runtime.py |
unit
|
python | This pytest unit test verifies remote runtime stability and performance under multi-process stress conditions in a sandbox environment. |