OpenHands project is an open-source software engineering AI that can solve various software engineering tasks. This repository contains the regression test framework for OpenHands project.
To run the tests for OpenHands project, you can use the provided test runner script. Follow these steps:
- Ensure you have Python 3.6 or higher installed on your system.
- Install the required dependencies by running the following command in your terminal:
pip install -r requirements.txt
- Navigate to the root directory of the project.
- Run the test suite using the test runner script with the required arguments:
Replace
python evaluation/regression/run_tests.py --OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxx --model=gpt-4o
sk-xxxxxxxxxxxxxxxxxxxxxx
with your actual OpenAI API key. The default model isgpt-4o
, but you can specify a different model if needed.
The test runner will discover and execute all the test cases in the cases/
directory, and display the results of the test suite, including the status of each individual test case and the overall summary.
The test cases for OpenHands project are organized in the cases/
directory. Each test case has the following structure:
cases/
βββ hello-world/
β βββ task.txt
β βββ outputs/
β β βββ codeact_agent/
β β βββ workspace/
β β βββ hello_world.sh
β βββ test_hello_world.py
βββ create_web_app/
β βββ task.txt
β βββ outputs/
β β βββ codeact_agent/
β β βββ workspace/
β β βββ app.py
β β βββ requirements.txt
β β βββ static/
β β βββ templates/
β βββ test_create_web_app.py
βββ ...
task.txt
: This file contains the task description provided by the user.outputs/
: This directory contains the output generated by OpenHands for each agent.outputs/*/workspace/
: This directory contains the actual output files generated by OpenHands.test_*.py
: These are the test scripts that validate the output of OpenHands.
To add a new test case to the regression test framework, follow the same steps as described in the previous sections.
The test cases can be customized by modifying the fixtures defined in the conftest.py
file. The available fixtures are:
test_cases_dir
: The directory containing the test cases.task_file
: The path to thetask.txt
file for the current test case.workspace_dir
: The path to theworkspace/
directory for the current test case.model
: The model selected start the generation.run_test_case
: A fixture that runs OpenHands and generates the workspace for the current test case.
You can modify these fixtures to change the behavior of the test cases or add new ones as needed.
If you have any questions or need further assistance, feel free to reach out to the project maintainers.