Spaces:
Build error
Build error
File size: 2,115 Bytes
51ff9e5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
## Runtime Tests
This folder contains integration tests that verify the functionality of OpenHands' runtime environments and their interactions with various tools and features.
### What are Runtime Tests?
Runtime tests focus on testing:
- Tool interactions within a runtime environment (bash commands, browsing, file operations)
- Environment setup and configuration
- Resource management and cleanup
- Browser-based operations and file viewing capabilities
- IPython/Jupyter integration
- Environment variables and configuration handling
The tests can be run against different runtime environments (Docker, Local, Remote, Runloop, or Daytona) by setting the TEST_RUNTIME environment variable. By default, tests run using the Docker runtime.
### How are they different from Unit Tests?
While unit tests in `tests/unit/` focus on testing individual components in isolation, runtime tests verify:
1. Integration between components
2. Actual execution of commands in different runtime environments
3. System-level interactions (file system, network, browser)
4. Environment setup and teardown
5. Tool functionality in real runtime contexts
### Running the Tests
Run all runtime tests:
```bash
poetry run pytest ./tests/runtime
```
Run specific test file:
```bash
poetry run pytest ./tests/runtime/test_bash.py
```
Run specific test:
```bash
poetry run pytest ./tests/runtime/test_bash.py::test_bash_command_env
```
For verbose output, add the `-v` flag (more verbose: `-vv` and `-vvv`):
```bash
poetry run pytest -v ./tests/runtime/test_bash.py
```
### Environment Variables
The runtime tests can be configured using environment variables:
- `TEST_IN_CI`: Set to 'True' when running in CI environment
- `TEST_RUNTIME`: Specify the runtime to test ('docker', 'local', 'remote', 'runloop', 'daytona')
- `RUN_AS_OPENHANDS`: Set to 'True' to run tests as openhands user (default), 'False' for root
- `SANDBOX_BASE_CONTAINER_IMAGE`: Specify a custom base container image for Docker runtime
For more details on pytest usage, see the [pytest documentation](https://docs.pytest.org/en/latest/contents.html).
|