This commit is contained in:
mrT23
2024-01-28 20:30:40 +02:00
parent 47af04d158
commit 5f1722ed4a

View File

@ -1,11 +1,10 @@
# Test Tool 💎 # Test Tool 💎
By combining LLM abilities with static code analysis, the `test` tool generate tests for a selected component, based on the PR code changes. By combining LLM abilities with static code analysis, the `test` tool generate tests for a selected component, based on the PR code changes.
Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript.
It can be invoked manually by commenting on any PR: It can be invoked manually by commenting on any PR:
``` ```
/test component_name /test component_name
``` ```
where component_name is the name of a specific component in the PR. where 'component_name' is the name of a specific component in the PR.
To get a list of the components that changed in the PR, use the [`analyze`](https://github.com/Codium-ai/pr-agent/blob/main/docs/Analyze.md) tool. To get a list of the components that changed in the PR, use the [`analyze`](https://github.com/Codium-ai/pr-agent/blob/main/docs/Analyze.md) tool.
@ -17,9 +16,12 @@ ___
___ ___
<kbd><img src=https://codium.ai/images/pr_agent/test3.png width="768"></kbd> <kbd><img src=https://codium.ai/images/pr_agent/test3.png width="768"></kbd>
Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript.
### Configuration options ### Configuration options
- `num_tests`: number of tests to generate. Default is 3. - `num_tests`: number of tests to generate. Default is 3.
- `testing_framework`: the testing framework to use. If not set, for Python it will use `pytest`, for Java it will use `JUnit`, for C++ it will use `Catch2`, and for JavaScript and TypeScript it will use `jest`. - `testing_framework`: the testing framework to use. If not set, for Python it will use `pytest`, for Java it will use `JUnit`, for C++ it will use `Catch2`, and for JavaScript and TypeScript it will use `jest`.
- `avoid_mocks`: if set to true, the tool will try to avoid using mocks in the generated tests. Default is true. Note that even if this option is set to true, the tool might still use mocks if it cannot generate a test without them. - `avoid_mocks`: if set to true, the tool will try to avoid using mocks in the generated tests. Note that even if this option is set to true, the tool might still use mocks if it cannot generate a test without them. Default is true.
- `extra_instructions`: Optional extra instructions to the tool. For example: "use the following mock injection scheme: ...". - `extra_instructions`: Optional extra instructions to the tool. For example: "use the following mock injection scheme: ...".