mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 03:40:38 +08:00
s
This commit is contained in:
@ -32,6 +32,9 @@ Making pull requests less painful with an AI agent
|
||||
- [Why use PR-Agent?](#why-use-pr-agent)
|
||||
|
||||
## News and Updates
|
||||
### Jan 28, 2024
|
||||
- 💎 Test - A new tool, [`/test component_name`](https://github.com/Codium-ai/pr-agent/blob/main/docs/TEST.md), was added to PR-Agent Pro. The tool will generate tests for a selected component, based on the PR code changes.
|
||||
- 💎 Analyze - The [`/analyze`](https://github.com/Codium-ai/pr-agent/blob/main/docs/Analyze.md) tool was updated and simplified. It now presents a summary of the code components that were changed in the PR.
|
||||
### Jan 21, 2024
|
||||
- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will propose only suggestions that follow specific guidelines defined by the user.
|
||||
See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details.
|
||||
@ -168,6 +171,7 @@ See the [Tools Guide](./docs/TOOLS_GUIDE.md) for a detailed description of the d
|
||||
| | Improve | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| | ⮑ Extended | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| | [Custom Suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| | [Test](https://github.com/Codium-ai/pr-agent/blob/main/docs/Test.md) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| | Reflect and Review | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| | Update CHANGELOG.md | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| | Find Similar Issue | :white_check_mark: | | |
|
||||
|
25
docs/TEST.md
Normal file
25
docs/TEST.md
Normal file
@ -0,0 +1,25 @@
|
||||
# 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.
|
||||
Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript.
|
||||
It can be invoked manually by commenting on any PR:
|
||||
```
|
||||
/test component_name
|
||||
```
|
||||
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.
|
||||
|
||||
|
||||
An example [result](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429):
|
||||
|
||||
<kbd><img src=https://codium.ai/images/pr_agent/test1.png width="704"></kbd>
|
||||
___
|
||||
<kbd><img src=https://codium.ai/images/pr_agent/test2.png width="768"></kbd>
|
||||
___
|
||||
<kbd><img src=https://codium.ai/images/pr_agent/test3.png width="768"></kbd>
|
||||
|
||||
|
||||
### Configuration options
|
||||
- `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`.
|
||||
- `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.
|
||||
- `extra_instructions`: Optional extra instructions to the tool. For example: "use the following mock injection scheme: ...".
|
@ -90,6 +90,12 @@ extra_instructions = ""
|
||||
|
||||
[pr_analyze] # /analyze #
|
||||
|
||||
[pr_test] # /test #
|
||||
testing_framework = "" # specify the testing framework you want to use
|
||||
num_tests=3 # number of tests to generate. max 5.
|
||||
avoid_mocks=true # if true, the generated tests will prefer to use real objects instead of mocks
|
||||
extra_instructions = ""
|
||||
|
||||
[pr_config] # /config #
|
||||
|
||||
[github]
|
||||
|
Reference in New Issue
Block a user